How jQuery implements hide () and show ()

Did they set display: none or visibility: hidden ?

I am sure that display: none takes the element out of the normal stream, and visibility: hidden just hides the element, but still has a reserved space for it.

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

+46
jquery css
Oct 27 '08 at 6:29
source share
2 answers

Uses display .

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

In any case, you should look at the unpacked source to just familiarize yourself with it.

Edit 2: Comments mentioned using Firebug to find out what was going on. In fact, I really went into jQuery docs and used the Safari Web Inspector to find out what happened in the hide() demo to be sure of my answer.

+65
Oct. 27 '08 at 6:41
source share

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

+2
Oct 27 '08 at 6:55
source share



All Articles