animation.tweens[ index ].run( percent );
}
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
+
if ( percent < 1 && length ) {
return remaining;
} else {
);
// attach callbacks from options
- return animation.done( animation.opts.done, animation.opts.complete )
+ return animation.progress( animation.opts.progress )
+ .done( animation.opts.done, animation.opts.complete )
.fail( animation.opts.fail )
.always( animation.opts.always );
}
});
});
-asyncTest("Animation callbacks (#11797)", 8, function() {
+asyncTest("Animation callbacks (#11797)", 12, function() {
var targets = jQuery("#foo").children(),
- done = false;
+ done = false,
+ expectedProgress = 0;
targets.eq( 0 ).animate( {}, {
- duration: 10,
+ duration: 1,
+ progress: function( anim, percent ) {
+ equal( percent, 0, "empty: progress 0" );
+ },
done: function() {
ok( true, "empty: done" );
},
targets.eq( 1 ).animate({
opacity: 0
}, {
- duration: 10,
+ duration: 1,
+ progress: function( anim, percent ) {
+ equal( percent, 0, "stopped: progress 0" );
+ },
done: function() {
ok( false, "stopped: done" );
},
targets.eq( 2 ).animate({
opacity: 0
}, {
- duration: 10,
+ duration: 1,
+ progress: function( anim, percent ) {
+ equal( percent, expectedProgress, "async: progress " + expectedProgress );
+ // once at 0, once at 1
+ expectedProgress++;
+ },
done: function() {
ok( true, "async: done" );
},