/** * Provides requestAnimationFrame in a cross browser way. * @author paulirish / http://paulirish.com/ */ if ( !window.requestAnimationFrame ) { window.requestAnimationFrame = ( function() { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || //window.mozRequestAnimationFrame || // commented out for the moment, FF4 caps framerate at ~30fps: https://bugzilla.mozilla.org/show_bug.cgi?id=630127 window.oRequestAnimationFrame || window.msRequestAnimationFrame || function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) { window.setTimeout( callback, 1000 / 60 ); }; } )(); }