[Greasemonkey] What DOM node is visable at the top of a window?
Jeremy Dunck
jdunck at gmail.com
Mon Feb 6 15:33:21 EST 2006
On 2/6/06, Roderick McGuire <mcguire at telerama.com> wrote:
> If I could figure out what DOM node is shown at the top of the window, I
> could use compareDocumentPosition to figure out what headerNode to
> scroll to.
>
> But I don't see how to find this info.
>
> Thanks in advance for any info.
I think this discussion will give you a good starting point:
http://www.quirksmode.org/js/findpos.html
The top of the viewport is window.scrollY, so given that page's
findPosY and window.scrollY, you should be able to find the next
header below the top of the scroll.
More information about the Greasemonkey
mailing list