javascript - Proper way to pause animations when not in view -


i'm wondering whether there proper way pause requestanimationframe animations when user has scrolled , animation not in view anymore?

requestanimationframe automatically when browser displays tab, possible when user scrolls?

the way divide code in chunk of small functions.

as scroll down,keep track of how scrolling being done.

you can provide own custom conditions , use window.cancelanimationframe() after functions have been executed , not in focus.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -