X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Ffx%2Ffx.js;h=acd51226a5bce153d7930101d2b96d77eff93151;hb=5bb0902c5ef4cf767a5940799826e57f2fcfdd34;hp=51e81571819e7cd36c5dfcb475fd104001866de6;hpb=5e6c14993a1010a2f6e8ce1f1d5d64171d324581;p=jquery.git diff --git a/src/fx/fx.js b/src/fx/fx.js index 51e8157..acd5122 100644 --- a/src/fx/fx.js +++ b/src/fx/fx.js @@ -110,9 +110,13 @@ jQuery.fn.extend({ toggle: function( fn, fn2 ){ return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? this._toggle( fn, fn2 ) : - this.animate({ - height: "toggle", width: "toggle", opacity: "toggle" - }, fn, fn2); + fn ? + this.animate({ + height: "toggle", width: "toggle", opacity: "toggle" + }, fn, fn2) : + this.each(function(){ + jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ](); + }); }, /** @@ -314,7 +318,7 @@ jQuery.fn.extend({ for ( var p in prop ) if ( prop[p] == "hide" && hidden || prop[p] == "show" && !hidden ) return jQuery.isFunction(opt.complete) && opt.complete.apply(this); - + this.curAnim = jQuery.extend({}, prop); jQuery.each( prop, function(name, val){ @@ -360,7 +364,7 @@ jQuery.extend({ complete: fn || !fn && easing || jQuery.isFunction( speed ) && speed, duration: speed, - easing: fn && easing || easing && easing.constructor != Function && easing || "swing" + easing: fn && easing || easing && easing.constructor != Function && easing || (jQuery.easing.swing ? "swing" : "linear") }; opt.duration = (opt.duration && opt.duration.constructor == Number ?