Skip to content

Commit 07c8a9b

Browse files
louisremidmethvin
louisremi
authored andcommitted
Fix #11469. Exclude margins from the negative property check.
1 parent f40c862 commit 07c8a9b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/effects.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,12 @@ jQuery.extend( jQuery.fx, {
636636

637637
// Ensure props that can't be negative don't go there on undershoot easing
638638
jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) {
639-
jQuery.fx.step[ prop ] = function( fx ) {
640-
jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
641-
};
639+
// exclude marginTop, marginLeft, marginBottom and marginRight from this list
640+
if ( prop.indexOf( "margin" ) ) {
641+
jQuery.fx.step[ prop ] = function( fx ) {
642+
jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
643+
};
644+
}
642645
});
643646

644647
if ( jQuery.expr && jQuery.expr.filters ) {

0 commit comments

Comments
 (0)