diff --git a/src/effects.js b/src/effects.js index 523cd7d29..808635d01 100644 --- a/src/effects.js +++ b/src/effects.js @@ -620,7 +620,7 @@ jQuery.extend( jQuery.fx, { // Do not set anything below 0 jQuery.each([ "width", "height" ], function( i, prop ) { jQuery.fx.step[ prop ] = function( fx ) { - jQuery.style( fx.elem, prop, Math.max(0, fx.now) ); + jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit ); }; }); diff --git a/test/unit/effects.js b/test/unit/effects.js index 36335c43f..82067cb8b 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -324,6 +324,21 @@ test("animate table-cell width/height", function() { }); }); +test("animate percentage(%) on width/height", function() { + expect( 2 ); + + var $div = jQuery("