by cnp · 12y ago · 0 comments
You made the fatal UI mistake --and by fatal I mean absolutely unusable for a great % of users-- of tying your viewport scroll to a fixed incremental +1 tick on the scroll wheel. If a user is using a MacBook touchpad, it's way, way, way faster than a user using a mouse or scroll-wheel, or any other custom scrolling device.
Here's an example of a site doing it the right way: http://www.spaceneedle.com
The key is to ALWAYS normalize your scroll, regardless of platform or device. Not only does it make your scroll values uniform, it provides a much smoother experience for the user.
The way this has been historically solved is to capture the mouse scroll tick, and then apply a multiplier on the expected result to induce easing, and then pipe that result into the scroll position of your container. All of this should take place within a requestAnimationFrame.
In JavaScript it's as simple as
position += (targetPosition – currentWindow.scrollTop) * easing // generally between 0 and 1
This classic inching equation is your friend!
If you were to revise your demo by implementing the above (about 5 minutes of work) it would look absolutely phenomenal.
The cool thing about that space needle example was I could middle mouse button scroll with momentum too.
The middle mouse button does nothing on the posters example, so that's another feature to add.
That said, seems like a common criticism is scroll speed is too slow, so by changing a couple small params, I halved all the scroll speeds.
I might totally be missing something, but seems like the concern is just relationship of scroll to movement of objects which I define in a big object. That said, I am no JS whiz and might be doing it all wrong.
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: