aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2010-09-17 13:51:12 -0400
committerJohn Resig <jeresig@gmail.com>2010-09-17 13:51:12 -0400
commitd1f3dc9a04225b327b6fd6deb9d3913918054a9f (patch)
treea166d31a903953d00854eae2062a2e3a8971f50c /src
parent99fcf3babbba8b794fe8b0b2e20d517156cfd4d2 (diff)
downloadjquery-d1f3dc9a04225b327b6fd6deb9d3913918054a9f.tar.gz
jquery-d1f3dc9a04225b327b6fd6deb9d3913918054a9f.zip
Make sure that empty height/width values are still set.
Diffstat (limited to 'src')
-rw-r--r--src/css.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/css.js b/src/css.js
index 87f9abd70..9113be2ae 100644
--- a/src/css.js
+++ b/src/css.js
@@ -150,11 +150,16 @@ jQuery.each(["height", "width"], function( i, name ) {
},
set: function( elem, value ) {
- // ignore negative width and height values #1599
- value = parseFloat(value);
+ if ( value !== "" ) {
+ // ignore negative width and height values #1599
+ value = parseFloat(value);
- if ( value >= 0 ) {
- return value + "px";
+ if ( value >= 0 ) {
+ return value + "px";
+ }
+
+ } else {
+ return value;
}
}
};