mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
23 lines
541 B
JavaScript
23 lines
541 B
JavaScript
/**
|
|
* 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 );
|
|
|
|
};
|
|
|
|
} )();
|
|
|
|
}
|