Normal hide/show toggling was broken, this fixes it (#1219).

This commit is contained in:
John Resig 2007-06-21 02:52:53 +00:00
parent 5e6c14993a
commit 8b683b891f

View file

@ -110,9 +110,13 @@ jQuery.fn.extend({
toggle: function( fn, fn2 ){ toggle: function( fn, fn2 ){
return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ? return jQuery.isFunction(fn) && jQuery.isFunction(fn2) ?
this._toggle( fn, fn2 ) : this._toggle( fn, fn2 ) :
this.animate({ fn ?
height: "toggle", width: "toggle", opacity: "toggle" this.animate({
}, fn, fn2); height: "toggle", width: "toggle", opacity: "toggle"
}, fn, fn2) :
this.each(function(){
jQuery(this)[ jQuery(this).is(":hidden") ? "show" : "hide" ]();
});
}, },
/** /**