469,927 Members | 1,855 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

javascript and hyperlinks..

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?

Thanks a lot.
Jul 23 '05 #1
1 1093
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)
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Albert | last post: by
1 post views Thread by Axel Dahmen | last post: by
1 post views Thread by Elmo Watson | last post: by
26 posts views Thread by wardy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.