Skip to content
Permalink
Browse files

Fix for #1214, #1216, #1234 (problem with animations). In a nutshell,…

… the callback needs to occur even if the animation does not run.
  • Loading branch information
jeresig committed Jun 21, 2007
1 parent 6f51075 commit 5e6c14993a1010a2f6e8ce1f1d5d64171d324581
Showing with 5 additions and 6 deletions.
  1. +5 −6 src/fx/fx.js
@@ -307,16 +307,15 @@ jQuery.fn.extend({
*/
animate: function( prop, speed, easing, callback ) {
return this.queue(function(){
var hidden = jQuery(this).is(":hidden");
var hidden = jQuery(this).is(":hidden"),
opt = jQuery.speed(speed, easing, callback),
self = this;

for ( var p in prop )
if ( prop[p] == "hide" && hidden ||
prop[p] == "show" && !hidden )
return;
if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden )
return jQuery.isFunction(opt.complete) && opt.complete.apply(this);

this.curAnim = jQuery.extend({}, prop);
var opt = jQuery.speed(speed, easing, callback);
var self = this;

jQuery.each( prop, function(name, val){
var e = new jQuery.fx( self, opt, name );

0 comments on commit 5e6c149

Please sign in to comment.
You can’t perform that action at this time.