Steady.js — no more scroll jank (lafikl.github.io)
over 9 years ago from Jake Lazaroff, devsigner
over 9 years ago from Jake Lazaroff, devsigner
Anyone care to give the layman's terms on why this is awesome? Not hating, just genuinely curious. I just read through the page and don't understand what this is doing that's so great or new.
John Resig has a good writeup on some potential pitfalls in attaching listeners to the scroll event: http://ejohn.org/blog/learning-from-twitter/
In addition to throttling the function call, Steady makes use of requestAnimationFrame (https://developer.mozilla.org/en-US/docs/Web/API/window.requestAnimationFrame) which will almost always perform better than setting an interval with a callback method.
Thanks. I didn't know what this was for either.
Since starting to code my own game, I've been using requestAnimationFrame everywhere. It just seems like the smart way to go when you're procedurally forcing repaints.
Not sure if it actually is the right thing to do, it just feels that way to me. (I still consider myself new to js)
Designer News
Where the design community meets.
Designer News is a large, global community of people working or interested in design and technology.
Have feedback?
Login to Comment
You'll need to log in before you can leave a comment.
LoginRegister Today
New accounts can leave comments immediately, and gain full permissions after one week.
Register now