Skip to content

Instantly share code, notes, and snippets.

@knugie
Created October 10, 2014 03:39
Show Gist options
  • Select an option

  • Save knugie/3222eb87588d2a8e56be to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

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