javascript and hyperlinks..

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Katsaridas

    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.
  • Michael Winter

    #2
    Re: javascript and hyperlinks..

    On 17 Apr 2004 12:25:35 -0700, John Katsaridas <jkatsaridas@ya hoo.com>
    wrote:
    [color=blue]
    > 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?[/color]

    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.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk" to reply)

    Comment

    Working...