Skip to content

suggestion: Use requestAnimationFrame instead of window.onresize. #12

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

Open
ghost opened this issue Jan 17, 2017 · 2 comments
Open

suggestion: Use requestAnimationFrame instead of window.onresize. #12

ghost opened this issue Jan 17, 2017 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 17, 2017

In some of my personal apps, I've noticed that making an animation loop with requestAnimationFrame and detecting window size inside there then updating stuff seems to be smoother than relying on window.onresize (https://github.com/sfirrin/Clean-Google-Calendar/blob/master/main.js#L37).

@ghost ghost changed the title suggestion: Use requestAnimationFrame instead of window.onResize. suggestion: Use requestAnimationFrame instead of window.onresize. Jan 17, 2017
@ghost
Copy link
Author

ghost commented Jan 17, 2017

An example: https://infamous.io/

On desktop, try resizing with the mouse back and forth. The layout (the content at the bottom) is generated with JavaScript that is hooked in by requestAnimationFrame.

@ghost
Copy link
Author

ghost commented Jan 17, 2017

By the way, awesome Chrome app! 😃

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

0 participants