tags:

views:

808

answers:

2

Do they set display: none or visibility: hidden?

I'm pretty sure display: none takes the element out of the normal flow, whilst visibility: hidden just hides the element but still has a reserved space for it.

Should I just go download the unpacked version and study it or does someone have a quick answer?

+20  A: 

It uses display.

Edit: And from John Sheehan's comment on this answer, which I agree with:

You should go view the unpacked source anyway just to familiarize yourself with it

Edit 2: Comments have mentioned using Firebug to discover what is happening. Indeed, I actually went to the jQuery docs and used the Safari Web Inspector to see what happened on the hide() demo to be sure of my answer.

eyelidlessness
This is correct. You should go view the unpacked source anyway just to familiarize yourself with it
John Sheehan
Also, using FireBug with FireFox and observing the changes in real-time on elements as you use jQuery is helpful (at least I've found it to be so)
chadmyers
Voting up - I always develop with the unpacked code in case (well, actually WHEN) I need to debug. I'll ship with the packed code.
paxdiablo
Thank you, I have never looked at the unpacked version. Though I might soon. I did use Firebug to view the updated DOM an you are indeed correct. Thank you very much!
alex
+1  A: 

It uses display, and for this type of thing you can use Firebug to actually examine what happens to the DOM.

Parand