In my project, I have a box whose contents are partially hidden, and
the bottom part should be displayed and hidden when you click show/
hide buttons. I've used $(...).toggle() for that, and I've noticed
that it only works the first time (i.e. when the contents are hidden).
show() and hide() work as expected, but toggle() always works like show
(). Also, is(":hidden") always returns true and is(":visible") always
returns false.
This is probably related to the change to hidden and visible matchers
done in 1.3.2, because the same html works perfectly well with 1.3.1.
I've also tried the latest trunk version (rev. 6302) and it has the
same problem as 1.3.2. It's reproducible in Firefox 3 and Safari 4.
On Tue, Mar 31, 2009 at 8:42 AM, Jakub Suder <jakub.su...@gmail.com> wrote:
> Hi,
> In my project, I have a box whose contents are partially hidden, and
> the bottom part should be displayed and hidden when you click show/
> hide buttons. I've used $(...).toggle() for that, and I've noticed
> that it only works the first time (i.e. when the contents are hidden).
> show() and hide() work as expected, but toggle() always works like show
> (). Also, is(":hidden") always returns true and is(":visible") always
> returns false.
> This is probably related to the change to hidden and visible matchers
> done in 1.3.2, because the same html works perfectly well with 1.3.1.
> I've also tried the latest trunk version (rev. 6302) and it has the
> same problem as 1.3.2. It's reproducible in Firefox 3 and Safari 4.
No, it doesn't. I'm not sure why but the offsetWidth and offsetHeight
values for the #more element are always 0, even after you call show()
on it and it shows up.
Well, if #more doesn't have a height or width (for example, only
contains floated elements and no actual content) then it won't matter.
One solution is to make sure that the element has an overflow: auto;
Regardless, I'll make a note of this and see if there's anything that
we can't do for 1.3.3.
> No, it doesn't. I'm not sure why but the offsetWidth and offsetHeight
> values for the #more element are always 0, even after you call show()
> on it and it shows up.