I am positioning an element via percentages (i.e. 50% - middle of the page) through the style element of the div tag(style="position:relative;left:50%"
. That way it will stay in the middle of the page at all times. Since I did it this way, is it possible to grab the actual pixel coordinates of the element at any given time through javascript?
Reason being, I want to test other elements that are scrolling by to see if they are over this element; so I need to compare x coordinates. But since I used percentages in the style attribute, the left style is not populated.
Any help is greatly appreciated.
Reason being, I want to test other elements that are scrolling by to see if they are over this element; so I need to compare x coordinates. But since I used percentages in the style attribute, the left style is not populated.
Any help is greatly appreciated.