Skip to content

Commit

Permalink
small utils file
Browse files Browse the repository at this point in the history
  • Loading branch information
dschwen committed Feb 8, 2013
1 parent 9ee21f0 commit befe89d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Provides requestAnimationFrame in a cross browser way.
*/
window.requestAnimFrame = (function() {
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(/* function FrameRequestCallback */ callback, /* DOMElement Element */ element) {
window.setTimeout(callback, 1000/60);
};
})();

0 comments on commit befe89d

Please sign in to comment.