Created
October 10, 2014 03:39
-
-
Save knugie/3222eb87588d2a8e56be to your computer and use it in GitHub Desktop.
cancel all request animation frames
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.cancelRequestAnimFrame = ( function() { | |
return window.cancelAnimationFrame || | |
window.webkitCancelRequestAnimationFrame || | |
window.mozCancelRequestAnimationFrame || | |
window.oCancelRequestAnimationFrame || | |
window.msCancelRequestAnimationFrame || | |
clearTimeout | |
} )(); | |
for (var i = 1; i < 99999; i++) { | |
window.clearInterval(i); | |
window.cancelRequestAnimFrame(i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you are clever