Only set height/width if it's a non-negative number (don't set it to 0).
[jquery.git] / src / css.js
index dd0ca4e..b95eb47 100644 (file)
@@ -123,7 +123,11 @@ jQuery.each(["height", "width"], function( i, name ) {
 
                set: function( elem, value ) {
                        // ignore negative width and height values #1599
-                       return Math.max( parseFloat(value), 0 ) + "px";
+                       value = parseFloat(value);
+
+                       if ( value >= 0 ) {
+                               return value + "px";
+                       }
                }
        };
 });