}
},
+ timers: [],
+
/*
* I originally wrote fx() as a clone of moo.fx and in the process
* of making it small in size the code became illegible to sane
z.now = from;
z.a();
- z.timer = setInterval(function(){
- z.step(from, to);
- }, 13);
+ jQuery.timers.push(function(){
+ return z.step(from, to);
+ });
+
+ if ( jQuery.timers.length == 1 ) {
+ var timer = setInterval(function(){
+ jQuery.timers = jQuery.grep( jQuery.timers, function(fn){
+ return fn();
+ });
+
+ if ( !jQuery.timers.length )
+ clearInterval( timer );
+ }, 13);
+ }
};
// Simple 'show' function
var t = (new Date()).getTime();
if (t > options.duration + z.startTime) {
- // Stop the timer
- clearInterval(z.timer);
- z.timer = null;
-
z.now = lastNum;
z.a();
if ( done && jQuery.isFunction( options.complete ) )
// Execute the complete function
options.complete.apply( elem );
+
+ return false;
} else {
var n = t - this.startTime;
// Figure out where in the animation we are and set the number
// Perform the next step of the animation
z.a();
}
+
+ return true;
};
}