One way to do this is to add up the offsetLeft and offsetTop properties starting at your element, and recursing up the offsetParent chain. Something like:
Code:
var start = <starting element>
for( var p = start; p != null; p = p.offsetParent ) {
start.myLeft += p.offsetLeft;
start.myTop += p.offsetTop;
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.