Skip to content

Instantly share code, notes, and snippets.

@githiro
Created June 12, 2013 12:37
Show Gist options
  • Select an option

  • Save githiro/5764878 to your computer and use it in GitHub Desktop.

Select an option

Save githiro/5764878 to your computer and use it in GitHub Desktop.
JS: requestAnimationFrame(cross browser)
if (!window.requestAnimationFrame) {
window.requestAnimationFrame = (function() {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback) {
window.setTimeout(callback, 1000 / 60);
};
})();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment