Skip to content

Instantly share code, notes, and snippets.

@culttm
Created September 28, 2015 09:45
Show Gist options
  • Select an option

  • Save culttm/6937eff1ae65601324a7 to your computer and use it in GitHub Desktop.

Select an option

Save culttm/6937eff1ae65601324a7 to your computer and use it in GitHub Desktop.
POLYFILL for requestAnimationFrame
//=========================================================================
// POLYFILL for requestAnimationFrame
//=========================================================================
if (!window.requestAnimationFrame) { // http://paulirish.com/2011/requestanimationframe-for-smart-animating/
window.requestAnimationFrame = window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(callback, element) {
window.setTimeout(callback, 1000 / 60);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment