Reputation: 10513
I use this function to get the y-coordinate of an element relative to the page:
function getY(oElement)
{
var curtop = 0;
if (oElement.offsetParent)
{
while (oElement.offsetParent)
{
curtop += oElement.offsetTop;
oElement = oElement.offsetParent;
}
}
else if (oElement.y)
{
curtop += oElement.y;
}
return curtop;
}
Now I want to do the same thing but get the position relative to the bottom instead of the top, there doesn't seem to be something like 'offsetBottom'.
How can I do this?
Many thanks
Upvotes: 1
Views: 2069