mirror of
https://github.com/wahyd4/three.js.git
synced 2026-08-19 09:56:12 +10:00
24 lines
546 B
JavaScript
24 lines
546 B
JavaScript
/**
|
|
* Provides requestAnimationFrame in a cross browser way.
|
|
* @author greggman / http://greggman.com/
|
|
*/
|
|
|
|
if ( !window.requestAnimationFrame ) {
|
|
|
|
window.requestAnimationFrame = ( function() {
|
|
|
|
return window.requestAnimationFrame ||
|
|
window.webkitRequestAnimationFrame ||
|
|
window.mozRequestAnimationFrame ||
|
|
window.oRequestAnimationFrame ||
|
|
window.msRequestAnimationFrame ||
|
|
function( /* function FrameRequestCallback */ callback, /* DOMElement Element */ element ) {
|
|
|
|
window.setTimeout( callback, 1000 / 60 );
|
|
|
|
};
|
|
|
|
} )();
|
|
|
|
}
|