aboutsummaryrefslogtreecommitdiffstats
path: root/src/effects.js
diff options
context:
space:
mode:
authorlouisremi <louisremi@louisremi-laptop.(none)>2011-05-10 11:22:12 -0400
committerJohn Resig <jeresig@gmail.com>2011-05-10 11:22:12 -0400
commit521ae562daa8f95def8872a55a260e9bdbc40d8b (patch)
tree1510ebd92680f03084c01abc82a2c64172576515 /src/effects.js
parent304dd618b7aa17158446bedd80af330375d8d4d4 (diff)
parent966c2fe46a785a2555ec9a1048fc4a9014c40aa3 (diff)
downloadjquery-521ae562daa8f95def8872a55a260e9bdbc40d8b.tar.gz
jquery-521ae562daa8f95def8872a55a260e9bdbc40d8b.zip
Landing pull request 374. .animate() Callbacks should fire in correct order (unit test included). Fixes #9100.
More Details: - https://github.com/jquery/jquery/pull/374 - https://github.com/jquery/jquery/issues/9100
Diffstat (limited to 'src/effects.js')
-rw-r--r--src/effects.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/effects.js b/src/effects.js
index 88661e0e9..38d5a0119 100644
--- a/src/effects.js
+++ b/src/effects.js
@@ -258,7 +258,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) {
@@ -522,11 +521,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);
}
}