Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAF #4

Open
samburgers opened this issue Aug 13, 2017 · 4 comments
Open

RAF #4

samburgers opened this issue Aug 13, 2017 · 4 comments

Comments

@samburgers
Copy link

heya, does (or should) this use requestAnimationFrame? the demo example is quite janky in chrome even. cheers!

@stutrek
Copy link
Owner

stutrek commented Aug 13, 2017

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.

@samburgers
Copy link
Author

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?

@stutrek
Copy link
Owner

stutrek commented Aug 14, 2017

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.

@lazysergey
Copy link

works smoothly in OSx crhome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants