3 ms·
As a best-practices criticism, this is using a direct window scroll handler, which can be a bit of a performance nightmare. It's often better to use some sort o
by kemayo 14y ago
As a best-practices criticism, this is using a direct window scroll handler, which can be a bit of a performance nightmare. It's often better to use some sort of throttling to make sure your scroll handler only runs every X ms. The tradeoff there, of course, is that you get a slightly less buttery-smooth pinning experience... but in return your pages will still scroll nicely on non-zippy machines.
Resig wrote about this after it horribly mauled Twitter a few years back: http://ejohn.org/blog/learning-from-twitter/ http://ejohn.org/blog/learning-from-twitter/