parent
573652505f
commit
9c7514abd2
|
@ -322,14 +322,14 @@
|
||||||
(function() {
|
(function() {
|
||||||
var lastTime = 0;
|
var lastTime = 0;
|
||||||
var vendors = ['ms', 'moz', 'webkit', 'o'];
|
var vendors = ['ms', 'moz', 'webkit', 'o'];
|
||||||
for(var x = 0; x < vendors.length && !window.requestAnimationFrameFrame; ++x) {
|
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
|
||||||
window.requestAnimationFrameFrame = window[vendors[x]+'requestAnimationFrameFrame'];
|
window.requestAnimationFrame = window[vendors[x]+'requestAnimationFrame'];
|
||||||
window.cancelAnimationFrame =
|
window.cancelAnimationFrame =
|
||||||
window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelrequestAnimationFrameFrame'];
|
window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelrequestAnimationFrame'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!window.requestAnimationFrameFrame)
|
if (!window.requestAnimationFrame)
|
||||||
window.requestAnimationFrameFrame = function(callback, element) {
|
window.requestAnimationFrame = function(callback, element) {
|
||||||
var currTime = new Date().getTime();
|
var currTime = new Date().getTime();
|
||||||
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
||||||
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
|
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
|
||||||
|
|
Loading…
Reference in New Issue