]> source.dussan.org Git - jquery.git/commitdiff
.animate() Callbacks should fire in correct order (fix #9100 + unit test)
authorlouisremi <louisremi@louisremi-laptop.(none)>
Mon, 9 May 2011 15:35:51 +0000 (17:35 +0200)
committerlouisremi <louisremi@louisremi-laptop.(none)>
Mon, 9 May 2011 15:35:51 +0000 (17:35 +0200)
src/effects.js

index 832ef5da0e016c8ad34a094f8505f4dbbdd8c205..956005089654d944475c6bd3895f54e3aacf4d07 100644 (file)
@@ -253,7 +253,6 @@ jQuery.fn.extend({
                        if ( !gotoEnd ) {
                                jQuery._unmark( true, this );
                        }
-                       // go in reverse order so anything added to the queue during the loop is ignored
                        while ( i-- ) {
                                if ( timers[i].elem === this ) {
                                        if (gotoEnd) {
@@ -517,11 +516,9 @@ jQuery.fx.prototype = {
 
 jQuery.extend( jQuery.fx, {
        tick: function() {
-               var timers = jQuery.timers,
-                       i = timers.length;
-               while ( i-- ) {
+               for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) {
                        if ( !timers[i]() ) {
-                               timers.splice(i, 1);
+                               timers.splice(i--, 1);
                        }
                }