]> source.dussan.org Git - jquery.git/commitdiff
Only set height/width if it's a non-negative number (don't set it to 0).
authorjeresig <jeresig@gmail.com>
Thu, 9 Sep 2010 20:34:15 +0000 (16:34 -0400)
committerjeresig <jeresig@gmail.com>
Thu, 9 Sep 2010 20:34:15 +0000 (16:34 -0400)
src/css.js

index dd0ca4e296ad7d0ca8560b872d785199a805520a..b95eb47d0d816e64af59f77a47c4574da3061ba9 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";
+                       }
                }
        };
 });