Hacker News new | ask | show | jobs
by cnp 4414 days ago
Running your scroll within requestAnimationFrame isn't what makes the scrolling smooth, its the scroll multiplier which does it, making sure that deltas (or changes) in the y-position are normalized down into what will eventually be a zero, but over time. By constantly updating the future scroll position by running in through the equation and then applying it to your container whenever the user scrolls, you'll achieve a nice ease, which can then be dispatched to each of your parallax layers.

Here, I've just pushed an example to Github and Firebase. Feel free to check it out and let me know if you have any questions:

https://smoothscroll.firebaseapp.com/

https://github.com/damassi/smooth-scroll-example