There were a couple of posts I read this morning that left me slightly 
confused: the use of display:none or visibility:hidden and jquery's hide() / 
show()

So, I experimented.

Rather than loading a bunch of stuff on your page and then setting scads of it 
invisible by using hide(), it makes sense to have a class like: .hideimage { 
display:none} and use that class on those things you want hidden. 
Alternatively, if they have some other class attached to them, you can use an 
inline  style="display:none"

The problem with display:none is that it leaves no defined space on the page so 
when you show() it, things move around, and move back again when you hide() it. 
Apparently, jquery is just adding and removing this style with hide() and 
show().

visibility:hidden does make room on the page. That may or may not be 
stylistically good. You can't use hide() and show() with it, though.

At http://basketbasics.com/gen/hide-experiment.htm you can see how it works.

  *   Show 1 shows the button (and moves the text)
  *   Show 2 does nothing
  *   The bottom half is self explanatory

I don't know if this clarifies the issue for anyone else, but it helped me see 
the difference. Right-click to see the code (which finishes the explanation).


Larry Stephens


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:353748
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to