Skip to content

Instantly share code, notes, and snippets.

@gonzaloruizdevilla
Created March 25, 2012 19:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gonzaloruizdevilla/2199269 to your computer and use it in GitHub Desktop.
Save gonzaloruizdevilla/2199269 to your computer and use it in GitHub Desktop.
requestAnimationFrame polyfill bien compacta
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