Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit b9371a6ca4b756c4b4266a08336e80f715b66ad3 1 parent 084079d
davidserduke authored November 16, 2007

Showing 1 changed file with 7 additions and 4 deletions. Show diff stats Hide diff stats

  1. 11  src/fx.js
11  src/fx.js
@@ -222,6 +222,7 @@ jQuery.extend({
222 222
 	},
223 223
 	
224 224
 	timers: [],
  225
+	timerId: null,
225 226
 
226 227
 	fx: function( elem, options, prop ){
227 228
 		this.options = options;
@@ -276,16 +277,18 @@ jQuery.fx.prototype = {
276 277
 
277 278
 		jQuery.timers.push(t);
278 279
 
279  
-		if ( jQuery.timers.length == 1 ) {
280  
-			var timer = setInterval(function(){
  280
+		if ( jQuery.timerId == null ) {
  281
+			jQuery.timerId = setInterval(function(){
281 282
 				var timers = jQuery.timers;
282 283
 				
283 284
 				for ( var i = 0; i < timers.length; i++ )
284 285
 					if ( !timers[i]() )
285 286
 						timers.splice(i--, 1);
286 287
 
287  
-				if ( !timers.length )
288  
-					clearInterval( timer );
  288
+				if ( !timers.length ) {
  289
+					clearInterval( jQuery.timerId );
  290
+					jQuery.timerId = null;
  291
+				}
289 292
 			}, 13);
290 293
 		}
291 294
 	},

0 notes on commit b9371a6

Please sign in to comment.
Something went wrong with that request. Please try again.