Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix #1827 bug where extra setInterval()s can be called during animation.

  • Loading branch information...
commit b9371a6ca4b756c4b4266a08336e80f715b66ad3 1 parent 084079d
@davidserduke davidserduke authored
Showing with 7 additions and 4 deletions.
  1. +7 −4 src/fx.js
View
11 src/fx.js
@@ -222,6 +222,7 @@ jQuery.extend({
},
timers: [],
+ timerId: null,
fx: function( elem, options, prop ){
this.options = options;
@@ -276,16 +277,18 @@ jQuery.fx.prototype = {
jQuery.timers.push(t);
- if ( jQuery.timers.length == 1 ) {
- var timer = setInterval(function(){
+ if ( jQuery.timerId == null ) {
+ jQuery.timerId = setInterval(function(){
var timers = jQuery.timers;
for ( var i = 0; i < timers.length; i++ )
if ( !timers[i]() )
timers.splice(i--, 1);
- if ( !timers.length )
- clearInterval( timer );
+ if ( !timers.length ) {
+ clearInterval( jQuery.timerId );
+ jQuery.timerId = null;
+ }
}, 13);
}
},
Please sign in to comment.
Something went wrong with that request. Please try again.