mirror of
https://github.com/jquery/jquery.git
synced 2026-02-07 03:55:17 -05:00
Make sure that width or height don't animate to a negative value. Fixes #3881.
This commit is contained in:
@@ -432,7 +432,7 @@ jQuery.extend( jQuery.fx, {
|
||||
|
||||
_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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user