JQuery Waypoints - execute a function whenever you scroll to an element
imakewebthings.github.com
imakewebthings.github.com
You can change the throttle by setting $.waypoints.settings.scrollThrottle = 50, or whatever number you like, to try to reduce flickers in cases like these. Just be aware its a balance you'll be striking with executing more scroll checks. But all the selectors and offset values are cached so the performance should still hold up should you choose to lower this value.
If I notice it, then by definition it is too bad.
However I think this is more due to the generous use of drop shadows than the javascript.
Just tried with the webkit inspector, if you remove all the box-shadow, the page is smooth.
What, you were expecting the first code they wrote to be perfect?
I very much disagree. It's an awesome way to capture the reader. I love it myself, not needed reloads, hunting for 'next' buttons, ... Yes you lose the relative position on the page indicator from the scroll bar, but it's irrelevant by the time you get to the bottom of the page anyway.
Either way, I wouldn't deploy this just yet. But I also wouldn't deploy a PNG background that's position: fixed, because I remember it crippling old versions of Firefox on Windows..
I guess it depends, but us users with slow computers avoid websites that point out the fact that we haven't upgraded for 4 years.. I think the web is most definitely the one place where you can't presume everyone is on par with Moore's law. You just can't increase performance requirements according to your workstation (at least not on the client-side).
Remember any leet Flash websites from 2001 (besides 2advanced, err) where the stop-motion effect would reveal your CPU's inferiority to the developers machine? Exactly, me neither (there were a lot of them though).
I hope the plugin takes off, but it won't happen until it performs. Making websites slow on old computers is much like making type too small for the visually impaired.
Mobile Safari parses websites as a big canvas and then pretends the screen is a window through which you're looking at the canvas. What you think of as scrolling, the browser thinks of as moving the canvas around (or the window depending on point of view).
Because of that, no scroll events ever get fired. Even :fixed doesn't behave as expected.
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.