Skip to content

Commit

Permalink
first tick should not occur immediatly; no tick should happen after a…
Browse files Browse the repository at this point in the history
… stop()

+ comments
  • Loading branch information
louisremi authored and timmywil committed Apr 4, 2011
1 parent 15e34d1 commit c95ab2a
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/effects.js
Expand Up @@ -363,17 +363,16 @@ jQuery.fx.prototype = {
t.elem = this.elem;

if ( t() && jQuery.timers.push(t) && !timerId ) {
if ( jQuery.support.requestAnimationFrame ) {
timerId = true;
(function raf() {
// Use requestAnimationFrame instead of setInterval if available
( timerId = jQuery.support.requestAnimationFrame ) ?
window[timerId](function raf() {
// timerId will be true as long as the animation hasn't been stopped
if (timerId) {
window[jQuery.support.requestAnimationFrame](raf);
window[timerId](raf);
fx.tick();
}
fx.tick();
})();
} else {
}):
timerId = setInterval(fx.tick, fx.interval);
}
}
},

Expand Down

0 comments on commit c95ab2a

Please sign in to comment.