From ae0e6d987781d2fbf225611e2f8df37380a2bbcd Mon Sep 17 00:00:00 2001 From: yo mama Date: Thu, 12 Feb 2015 18:29:27 -0800 Subject: first --- js/RequestAnimationFrame.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 js/RequestAnimationFrame.js (limited to 'js/RequestAnimationFrame.js') diff --git a/js/RequestAnimationFrame.js b/js/RequestAnimationFrame.js new file mode 100644 index 0000000..77f85c5 --- /dev/null +++ b/js/RequestAnimationFrame.js @@ -0,0 +1,22 @@ +/** + * Provides requestAnimationFrame in a cross browser way. + * http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + */ + +if ( !window.requestAnimationFrame ) { + + window.requestAnimationFrame = ( function() { + + return window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + window.oRequestAnimationFrame || + window.msRequestAnimationFrame || + function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) { + + window.setTimeout( callback, 1000 / 60 ); + + }; + + } )(); + +} -- cgit v1.2.3-70-g09d2