Created
September 28, 2015 09:45
-
-
Save culttm/6937eff1ae65601324a7 to your computer and use it in GitHub Desktop.
POLYFILL for requestAnimationFrame
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //========================================================================= | |
| // 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