mirror of
https://github.com/wahyd4/three.js.git
synced 2026-08-09 13:06:01 +10:00
23 lines
514 B
JavaScript
23 lines
514 B
JavaScript
/**
|
|
* Provides requestAnimationFrame in a cross browser way.
|
|
* @author paulirish / http://paulirish.com/
|
|
*/
|
|
|
|
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 );
|
|
|
|
};
|
|
|
|
} )();
|
|
|
|
}
|