Live data from Hacker News

JQuery Waypoints - execute a function whenever you scroll to an element

imakewebthings.github.com

1–10 of 27 posts

Re: JQuery Waypoints - execute a function whenever you scroll to an element

#3
post #2

Nicely modular functionality. Would be even better if the events were implemented as actual jQuery events.

They are:

Calling .waypoint with no parameters will register the elements as waypoints using the default options. The elements will fire the waypoint.reached event, but calling it in this way does not bind any handler to the event. You can bind to the event yourself, as with any other event, like so:

    someElements.bind('waypoint.reached', function(event, direction) {
       // make it rain
    });
Calling .waypoint with a function is just a shortcut for that.

Re: JQuery Waypoints - execute a function whenever you scroll to an element

#9

Is it just me or does this feel really slow?

Not too bad. On the sticky elements example, if I furiously flick my scroll wheel downward, there is a noticeable but tiny delay for the section menu to "catch up" at the top of the screen. The infinite scroll example seems fine, as does the analytics example. Is there really any way to get faster performance in the first example other than just giving the section menu div position:fixed (which doesn't exactly do the same thing)?

Re: JQuery Waypoints - execute a function whenever you scroll to an element

#10
post #9

Is it just me or does this feel really slow?

Not too bad. On the sticky elements example, if I furiously flick my scroll wheel downward, there is a noticeable but tiny delay for the section menu to "catch up" at the top of the screen. The infinite scroll example seems fine, as does the analytics example. Is there really any way to get faster performance in the first example other than just giving the section menu div position:fixed (which doesn't exactly do the…

I think he means the main page, that one scrolls fairly jerky for me, too (OSX/Chrome).

However I think this is more due to the generous use of drop shadows than the javascript.

Post reply on HN