On 17 Apr 2004 12:25:35 -0700, John Katsaridas <jk*********@yahoo.com>
wrote:
I have an html document with a couple of hyperlinks. I start scrolling
from the top of the webpage downwards. When a certain hyperlink goes out
of the screen as I am scrolling (ie: the hyperlink reaches the top of
the screen and is removed from our field of view) I want a certain event
to take place,such as incrementing a counter keeping track how many time
this event has happened. How can I do this with javascript?
You can't. Whilst there is a "scroll" event, no data is defined for it.
That is, you can't obtain where the document was positioned before and
after the scroll, or what distance was scrolled, just that it happened.
Even if you could get that information, it wouldn't be simple to determine
what elements are out of view, and I doubt you could do it reliably anyway.
Mike
--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)