Make sure that empty height/width values are still set.

This commit is contained in:
John Resig 2010-09-17 13:51:12 -04:00
parent 99fcf3babb
commit d1f3dc9a04

View file

@ -150,12 +150,17 @@ jQuery.each(["height", "width"], function( i, name ) {
}, },
set: function( elem, value ) { set: function( elem, value ) {
if ( value !== "" ) {
// ignore negative width and height values #1599 // ignore negative width and height values #1599
value = parseFloat(value); value = parseFloat(value);
if ( value >= 0 ) { if ( value >= 0 ) {
return value + "px"; return value + "px";
} }
} else {
return value;
}
} }
}; };
}); });