aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlouisremi <louisremi@louisremi-laptop.(none)>2011-05-09 17:35:51 +0200
committerlouisremi <louisremi@louisremi-laptop.(none)>2011-05-09 17:35:51 +0200
commit076c347605c752821dfb6457044df4ba87b601c1 (patch)
tree3bb9552fa63f874506a2f34e86463301feca2da3
parentb5772da08748edbf22d3a6134b1764a787231e8b (diff)
downloadjquery-076c347605c752821dfb6457044df4ba87b601c1.tar.gz
jquery-076c347605c752821dfb6457044df4ba87b601c1.zip
.animate() Callbacks should fire in correct order (fix #9100 + unit test)
-rw-r--r--src/effects.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/effects.js b/src/effects.js
index 832ef5da0..956005089 100644
--- a/src/effects.js
+++ b/src/effects.js
@@ -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);
}
}