Skip to content

Instantly share code, notes, and snippets.

@knugie
Created October 10, 2014 03:39
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save knugie/3222eb87588d2a8e56be to your computer and use it in GitHub Desktop.
Save knugie/3222eb87588d2a8e56be to your computer and use it in GitHub Desktop.
cancel all request animation frames
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);
}
@likev
Copy link

likev commented Sep 30, 2022

you are clever

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment