Bug Tracker

Changeset 2129

Show
Ignore:
Timestamp:
06/21/07 02:38:16 (1 year ago)
Author:
jeresig
Message:

Fix for #1214, #1216, #1234 (problem with animations). In a nutshell, the callback needs to occur even if the animation does not run.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/jquery/src/fx/fx.js

    r1955 r2129  
    308308    animate: function( prop, speed, easing, callback ) { 
    309309        return this.queue(function(){ 
    310             var hidden = jQuery(this).is(":hidden"); 
     310            var hidden = jQuery(this).is(":hidden"), 
     311                opt = jQuery.speed(speed, easing, callback), 
     312                self = this; 
    311313             
    312314            for ( var p in prop ) 
    313                 if ( prop[p] == "hide" && hidden || 
    314                     prop[p] == "show" && !hidden ) 
    315                         return; 
     315                if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden ) 
     316                    return jQuery.isFunction(opt.complete) && opt.complete.apply(this); 
    316317         
    317318            this.curAnim = jQuery.extend({}, prop); 
    318             var opt = jQuery.speed(speed, easing, callback); 
    319             var self = this; 
    320319             
    321320            jQuery.each( prop, function(name, val){