Skip to content

Instantly share code, notes, and snippets.

@ianldgs
Created May 27, 2015 13:02
Show Gist options
  • Save ianldgs/acaad5410b2b89dff488 to your computer and use it in GitHub Desktop.
Save ianldgs/acaad5410b2b89dff488 to your computer and use it in GitHub Desktop.
Polyfill all browsers requestAnimationFrame
window.requestAnimationFrame = function(){
return (
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(/* function */ callback){
window.setTimeout(callback, (fadeInDuration + fadeOutDuration));
}
);
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment