From: John Resig Date: Fri, 17 Sep 2010 17:51:12 +0000 (-0400) Subject: Make sure that empty height/width values are still set. X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=d1f3dc9a04225b327b6fd6deb9d3913918054a9f;p=jquery.git Make sure that empty height/width values are still set. --- diff --git a/src/css.js b/src/css.js index 87f9abd..9113be2 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; } } };