diff options
-rw-r--r-- | src/effects.js | 5 | ||||
-rw-r--r-- | test/unit/effects.js | 9 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/effects.js b/src/effects.js index 1536d2d8e..790a63c8e 100644 --- a/src/effects.js +++ b/src/effects.js @@ -634,9 +634,8 @@ jQuery.extend( jQuery.fx, { } }); -// Adds width/height step functions -// Do not set anything below 0 -jQuery.each([ "width", "height" ], function( i, prop ) { +// Ensure props that can't be negative don't go there on undershoot easing +jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) { jQuery.fx.step[ prop ] = function( fx ) { 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 2078dc629..a3c2152ce 100644 --- a/test/unit/effects.js +++ b/test/unit/effects.js @@ -263,6 +263,15 @@ test("animate negative height", function() { }); }); +test("animate negative padding", function() { + expect(1); + stop(); + jQuery("#foo").animate({ paddingBottom: -100 }, 100, function() { + equal( jQuery(this).css("paddingBottom"), "0px", "Verify paddingBottom." ); + start(); + }); +}); + test("animate block as inline width/height", function() { expect(3); |