On 12/13/06, Dave Methvin <[EMAIL PROTECTED]> wrote:
> > ... the fx .show/.hide methods use the same logic as
> > the normal .show/.hide metheds (both .show methods
> > set display 'block').
>
> The non-fx show/hide try to preserve the original display value:
>
>         show: function(){
>                 this.style.display = this.oldblock ? this.oldblock : "";
>                 if ( jQuery.css(this,"display") == "none" )
>                         this.style.display = "block";
>         },
>         hide: function(){
>                 this.oldblock = this.oldblock || jQuery.css(this,"display");
>                 if ( this.oldblock == "none" )
>                         this.oldblock = "block";
>                 this.style.display = "none";
>         },
>
> There could be problems if someone used the fx hide and the standard show or
> vice versa, since fx doesn't use oldblock.

In the fx module the display property is stored as oldblock, then set
to display: block and then finally reverted if it is not a 'hide' type
animation.

> I am not sure why .show even needs that extra check for display:none; how
> could it be "none" when it was set on the line above and .hide() makes sure
> it isn't "none" as well? Nothing else in jQuery seems to mess with oldblock.

If the stylesheet says that the element is display: none by default,
then the check becomes necessary.

--
Brandon Aaron

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to