Make sure that .width()/.height() don't return NaN also standardize on returning instead of auto for default values (which is what we do elsewhere in .css() as well). Fixes #7225.

This commit is contained in:
jeresig 2010-10-22 02:39:06 -04:00
parent 7e02cee5ff
commit 53396b879b
3 changed files with 23 additions and 25 deletions

View file

@ -169,15 +169,11 @@ jQuery.each(["height", "width"], function( i, name ) {
});
}
if ( val < 0 ) {
return elem.style[ name ] || "0px";
}
if ( val === 0 ) {
if ( val <= 0 ) {
val = curCSS( elem, name, name );
if ( val != null ) {
return val;
return val === "auto" ? "" : val;
}
}