_default: function(fx){
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
- fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+ fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
} else {
fx.elem[ fx.prop ] = fx.now;
}
});
});
+test("animate negative height", function() {
+ expect(1);
+ stop();
+ jQuery("#foo").animate({ height: -100 }, 100, function() {
+ equals( this.offsetHeight, 0, "Verify height." );
+ start();
+ });
+});
+
/* // This test ends up being flaky depending upon the CPU load
test("animate option (queue === false)", function () {
expect(1);