From d1f3dc9a04225b327b6fd6deb9d3913918054a9f Mon Sep 17 00:00:00 2001 From: John Resig Date: Fri, 17 Sep 2010 13:51:12 -0400 Subject: [PATCH] Make sure that empty height/width values are still set. --- src/css.js | 13 +++++++++---- 1 file 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; } } };