Created
March 25, 2012 19:39
-
-
Save gonzaloruizdevilla/2199269 to your computer and use it in GitHub Desktop.
requestAnimationFrame polyfill bien compacta
This file contains 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
window.requestAnimFrame = (function(a,b){while(a--&&!(b=this["oR0msR0mozR0webkitR0r".split(0)[a]+"equestAnimationFrame"]));return b||function(a){setTimeout(a,15)}}(5)); | |
// uso: | |
(function loopAnimacion(){ | |
requestAnimFrame(loopAnimacion); | |
hazLosCalculos(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment