Make sure that empty height/width values are still set.
authorJohn Resig <jeresig@gmail.com>
Fri, 17 Sep 2010 17:51:12 +0000 (13:51 -0400)
committerJohn Resig <jeresig@gmail.com>
Fri, 17 Sep 2010 17:51:12 +0000 (13:51 -0400)
src/css.js

index 87f9abd..9113be2 100644 (file)
@@ -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;
                        }
                }
        };