diff options
author | jeresig <jeresig@gmail.com> | 2010-10-22 02:39:06 -0400 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2010-10-22 02:39:06 -0400 |
commit | 53396b879bd29c090824da182e3cf69158829f82 (patch) | |
tree | a273c7b167f177b3ba63c0934a16ce80bf5628c7 /src/css.js | |
parent | 7e02cee5ff8b5e9117366d7b43af7b5794f0f258 (diff) | |
download | jquery-53396b879bd29c090824da182e3cf69158829f82.tar.gz jquery-53396b879bd29c090824da182e3cf69158829f82.zip |
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.
Diffstat (limited to 'src/css.js')
-rw-r--r-- | src/css.js | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/css.js b/src/css.js index 88c4ffa05..30cecf39d 100644 --- a/src/css.js +++ b/src/css.js @@ -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; } } |