2
0

RequestAnimationFrame.js 546 B

1234567891011121314151617181920212223
  1. /**
  2. * Provides requestAnimationFrame in a cross browser way.
  3. * @author greggman / http://greggman.com/
  4. */
  5. if ( !window.requestAnimationFrame ) {
  6. window.requestAnimationFrame = ( function() {
  7. return window.requestAnimationFrame ||
  8. window.webkitRequestAnimationFrame ||
  9. window.mozRequestAnimationFrame ||
  10. window.oRequestAnimationFrame ||
  11. window.msRequestAnimationFrame ||
  12. function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) {
  13. window.setTimeout( callback, 1000 / 60 );
  14. };
  15. } )();
  16. }