View Single Post
Old 02-04-2011, 04:02 PM   PM User | #2
venegal
Gütkodierer


 
Join Date: Apr 2009
Posts: 2,127
Thanks: 1
Thanked 426 Times in 424 Posts
venegal has a spectacular aura aboutvenegal has a spectacular aura about
If you give an element display: none (and that's what's actually happening inside hide()), it will be removed from the document flow, and the positions of other elements will change. If you want a hidden element to stay in the flow and retain its position, use visibility: hidden instead.

So, instead of $(yourElement).hide() you do $(yourElement).css({visibility: 'hidden'}), and instead of $(yourElement).show() you do $(yourElement).css({visibility: 'visible'}).
venegal is offline   Reply With Quote
Users who have thanked venegal for this post:
leetvivi (02-04-2011)