[jQuery] Re: .hide() and .height()

2009-01-17 Thread Ricardo Tomasi
height() indeed works for hidden elements. If the element has display:none set it will briefly set display back, add visibility:hidden and return the correct height. See it working in this test page: http://jsbin.com/ucumo/ you said that .hide() causes the **parent** element to loose its

[jQuery] Re: .hide() and .height()

2009-01-16 Thread Michael Geary
.hide() sets the CSS style display:none. This takes the element out of the layout, so in effect its height and width are treated as if they were 0. The height and width don't actually change; you can set display:block or .show() to have the element displayed in its original size. If a parent

[jQuery] Re: .hide() and .height()

2009-01-16 Thread Karl Swedberg
On Jan 16, 2009, at 7:56 PM, Michael Geary wrote: snip If you want an element to become invisible but remain part of the layout, then set .attr({visibility:'hidden'}) instead of using .hide(). Use .attr({visibility:'visible'}) to display it again. Excellent explanation, as always, Mike.

[jQuery] Re: .hide() and .height()

2009-01-16 Thread Carl Von Stetten
Karl, How would one go about overriding jQuery's show() and hide() functions to move the desired element to a negative screen position (CSS left: -1) instead of changing the CSS display to none? Carl Karl Swedberg wrote: On Jan 16, 2009, at 7:56 PM, Michael Geary wrote: snip If you