[jQuery] POSSIBLE bug: slideUp / slideDown and nested divs
I just hit this problem myself.
I have done a bit of investigation, and I have a different solution and may
have uncovered a bug.
I am working with rev. 249
Bug first...
Somewhere around line 1313 is
setAuto: function(e,p)
in the middle of this function is a check
if ( p == "height" && e.scrollHeight != o ||
p == "width" && e.scrollWidth != o ) return;
it seems that e.scrollHeight is returning a number and o is returning a
string with 'px' at the end. So they never match and setAuto always bails
I fixed this like this
if ( p == "height" && e.scrollHeight+"px" != o ||
p == "width" && e.scrollWidth+"px" != o ) return;
I *think* this is right. I don't know what bad side-effects this may have.
Anyone know if this is a bug or not?
Back to point of the problem with nested divs...
After making the changes above
Around line 1507 is the following
// Reset the property, if the item has been hidden
if ( z.o.hide ) {
for ( var p in z.el.curAnim ) {
y[ p ] = z.el.orig[p] + ( p == "opacity" ? "" : "px" );
// set its height and/or width to auto
if ( p == 'height' || p == 'width' )
jQuery.setAuto( z.el, p );
}
}
By removing the check to see if the element has been hidden, the nested divs
work fine
// Reset the property, if the item has been hidden
//if ( z.o.hide ) {
for ( var p in z.el.curAnim ) {
y[ p ] = z.el.orig[p] + ( p == "opacity" ? "" : "px" );
// set its height and/or width to auto
if ( p == 'height' || p == 'width' )
jQuery.setAuto( z.el, p );
}
//}
Again, I am not sure if this is right and what sort of side-effects this
will have.
Anyone care to tell me the bad things that I have unleashed on myself?
-----Original Message-----
From: discuss-bounces@jquery.com [mailto:discuss-bounces@jquery.com] On
Behalf Of Mika Tuupola
Sent: Wednesday, October 04, 2006 2:13 AM
To: jQuery Discussion.
Subject: Re: [jQuery] slideUp / slideDown and nested divs