14 lines
494 B
JavaScript
14 lines
494 B
JavaScript
|
/**
|
||
|
* 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) {
|
||
|
return window.setTimeout(callback, 1000/60);
|
||
|
};
|
||
|
})();
|