first tick should not occur immediatly; no tick should happen after a stop()
+ comments
This commit is contained in:
parent
15e34d1f07
commit
c95ab2a39c
1 changed files with 7 additions and 8 deletions
15
src/effects.js
vendored
15
src/effects.js
vendored
|
@ -363,17 +363,16 @@ 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 ) {
|
||||||
if ( jQuery.support.requestAnimationFrame ) {
|
// Use requestAnimationFrame instead of setInterval if available
|
||||||
timerId = true;
|
( timerId = jQuery.support.requestAnimationFrame ) ?
|
||||||
(function raf() {
|
window[timerId](function raf() {
|
||||||
|
// timerId will be true as long as the animation hasn't been stopped
|
||||||
if (timerId) {
|
if (timerId) {
|
||||||
window[jQuery.support.requestAnimationFrame](raf);
|
window[timerId](raf);
|
||||||
}
|
|
||||||
fx.tick();
|
fx.tick();
|
||||||
})();
|
|
||||||
} else {
|
|
||||||
timerId = setInterval(fx.tick, fx.interval);
|
|
||||||
}
|
}
|
||||||
|
}):
|
||||||
|
timerId = setInterval(fx.tick, fx.interval);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue