14 lines
627 B
JavaScript
14 lines
627 B
JavaScript
export const requestAnimationFrame = window.requestAnimationFrame ||
|
|
window.webkitRequestAnimationFrame ||
|
|
window.mozRequestAnimationFrame ||
|
|
window.oRequestAnimationFrame ||
|
|
window.msRequestAnimationFrame ||
|
|
function (callback) { callback.timer = window.setTimeout(callback, 1000 / 60); };
|
|
|
|
export const cancelRequestAnimFrame = window.cancelAnimationFrame ||
|
|
window.webkitCancelRequestAnimationFrame ||
|
|
window.mozCancelRequestAnimationFrame ||
|
|
window.oCancelRequestAnimationFrame ||
|
|
window.msCancelRequestAnimationFrame ||
|
|
function (callback) { window.clearTimeout(callback.timer); };
|