Remove requestAnimationFrame support. Fixes #9381.

This commit is contained in:
timmywil 2011-08-16 11:21:01 -04:00
parent 0b8b636012
commit 2053d1c621

23
src/effects.js vendored
View File

@ -13,10 +13,7 @@ var elemdisplay = {},
// opacity animations // opacity animations
[ "opacity" ] [ "opacity" ]
], ],
fxNow, fxNow;
requestAnimationFrame = window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame;
jQuery.fn.extend({ jQuery.fn.extend({
show: function( speed, easing, callback ) { show: function( speed, easing, callback ) {
@ -392,8 +389,7 @@ jQuery.fx.prototype = {
// Start an animation from one number to another // Start an animation from one number to another
custom: function( from, to, unit ) { custom: function( from, to, unit ) {
var self = this, var self = this,
fx = jQuery.fx, fx = jQuery.fx;
raf;
this.startTime = fxNow || createFxNow(); this.startTime = fxNow || createFxNow();
this.start = from; this.start = from;
@ -409,20 +405,7 @@ jQuery.fx.prototype = {
t.elem = this.elem; t.elem = this.elem;
if ( t() && jQuery.timers.push(t) && !timerId ) { if ( t() && jQuery.timers.push(t) && !timerId ) {
// Use requestAnimationFrame instead of setInterval if available timerId = setInterval( fx.tick, fx.interval );
if ( requestAnimationFrame ) {
timerId = true;
raf = function() {
// When timerId gets set to null at any point, this stops
if ( timerId ) {
requestAnimationFrame( raf );
fx.tick();
}
};
requestAnimationFrame( raf );
} else {
timerId = setInterval( fx.tick, fx.interval );
}
} }
}, },