Tag Archives: Element

Find the position of an element with JavaScript

Quirksmode provides a nice findPos() function to find the absolute position of an element on a page. If you need to find the position of the element relative to the viewport then you will also need to know the page’s current scroll position, which I found over at Stack Overflow.
Posted in JavaScript | Also tagged , , , | Comments closed