JQuery Waypoints - execute a function whenever you scroll to an element
imakewebthings.github.com
JQuery Waypoints - execute a function whenever you scroll to an element
1–10 of 27 posts
Re: JQuery Waypoints - execute a function whenever you scroll to an element
#2Re: JQuery Waypoints - execute a function whenever you scroll to an element
#3Nicely modular functionality. Would be even better if the events were implemented as actual jQuery events.
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
#4Re: JQuery Waypoints - execute a function whenever you scroll to an element
#5Re: JQuery Waypoints - execute a function whenever you scroll to an element
#6Re: JQuery Waypoints - execute a function whenever you scroll to an element
#7Re: JQuery Waypoints - execute a function whenever you scroll to an element
#8Is it just me or does this feel really slow?
Re: JQuery Waypoints - execute a function whenever you scroll to an element
#9Is it just me or does this feel really slow?
Re: JQuery Waypoints - execute a function whenever you scroll to an element
#10Is 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…
However I think this is more due to the generous use of drop shadows than the javascript.