From 8b7015987cbd24c79f328bcf9260a6596a785bf5 Mon Sep 17 00:00:00 2001 From: jeresig Date: Thu, 9 Sep 2010 16:34:15 -0400 Subject: [PATCH] Only set height/width if it's a non-negative number (don't set it to 0). --- src/css.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/css.js b/src/css.js index dd0ca4e2..b95eb47d 100644 --- a/src/css.js +++ b/src/css.js @@ -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"; + } } }; });