scrollmonitor-parallax
scrollmonitor-parallax copied to clipboard
RAF
heya, does (or should) this use requestAnimationFrame? the demo example is quite janky in chrome even. cheers!
This does not us RAF as it's impossible to get two scroll events in a single frame. I did a lot of experimenting when I made the scrollmonitor to ensure that. It shouldn't use RAF because that would just delay the events and rendering by one frame.
I'm guessing your scroll wheel is the standard kind that scrolls in increments of 60px or so, so the parallax moves in the same increments. Instead of using the wheel try dragging the scroll bar to see if it's smoother. If you want to smooth everything out at the cost of responsiveness, you can put a transition of about 50ms on your elements.
Chrome browser on a 1yr old macbook using fluid touchpad to scroll. Adding transition: all 50ms linear helps a little, but still quite stuttery especially on the rotating element on the demo. Wonder if scroll event throttling might help a little if RAF doesn't appear to be a solution?
I don't know what's wrong, I suspect something with your video card. I've seen the demo running at 60fps on a phone. If anyone +1s this issue I'll take a deeper look, it may be that the way Chrome optimizes something has changed.
works smoothly in OSx crhome