aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Serduke <davidserduke@gmail.com>2007-11-16 21:50:27 +0000
committerDavid Serduke <davidserduke@gmail.com>2007-11-16 21:50:27 +0000
commitb9371a6ca4b756c4b4266a08336e80f715b66ad3 (patch)
tree6a46dc8d236c71d618277cfe9f7dd23c3b6eceef
parent084079d2fd1c7ed3582612cc32b01346b43fb415 (diff)
downloadjquery-b9371a6ca4b756c4b4266a08336e80f715b66ad3.tar.gz
jquery-b9371a6ca4b756c4b4266a08336e80f715b66ad3.zip
Fix #1827 bug where extra setInterval()s can be called during animation.
-rw-r--r--src/fx.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/fx.js b/src/fx.js
index 711825f99..e4c101561 100644
--- a/src/fx.js
+++ b/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);
}
},