Menu
I need to find the true x and y coordinates as well as the height and width of a particular element on a page. I have tried using offsetTop, offsetLeft, offsetHeight, and offsetWidth, but that does not seem to be working for all elements. I believe this may be because I have some absolute and relative positioning, but I am not really sure what the reason is. For example, sometimes the offsetTop that is returned is 0, even if I iterate through all of the element’s parents.
Does anyone know of a more accurate way to find an elements true coordinates and its current height and width?
Thanks in advance.