Hidden div height (changing my advice)

Posted by fudgey on Stack Overflow See other posts from Stack Overflow or by fudgey
Published on 2010-05-18T22:42:55Z Indexed on 2010/05/19 0:20 UTC
Read the original article Hit count: 521

Filed under:

Ok, I was going to answer someone's question here on SO about why their script wasn't working. They loaded content into a hidden div, then got the height so they could animate the wrapping div. But I always try to test the code I provide. So I made this demo to prove it to them.

So, umm, have I entered the twilight zone or am I dreaming right now? pinches self OUCH!

I tried that demo in Firefox, IE and Chrome and both methods return the same value. Firebug says zero! I rebooted my computer and I even changed the code a bit (removed the height function) and tried it with jQuery 1.3.2 and it still worked! I know hidden elements USED to return a zero value. Even this SO Answer is giving the advice I would have!

So I guess my question is... did I miss something or are we giving bad advice?

© Stack Overflow or respective owner

Related posts about jQuery