mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Fix the logic to set overflow:hidden on width & height animations - Fixes #12117 - Closes gh-869
This commit is contained in:
parent
3016872220
commit
94924a05de
2
src/effects.js
vendored
2
src/effects.js
vendored
@ -269,7 +269,7 @@ function defaultPrefilter( elem, props, opts ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// height/width overflow pass
|
// height/width overflow pass
|
||||||
if ( elem.nodeType === 1 && ( props.height || props.width ) ) {
|
if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
|
||||||
// Make sure that nothing sneaks out
|
// Make sure that nothing sneaks out
|
||||||
// Record all 3 overflow attributes because IE does not
|
// Record all 3 overflow attributes because IE does not
|
||||||
// change the overflow attribute when overflowX and
|
// change the overflow attribute when overflowX and
|
||||||
|
14
test/unit/effects.js
vendored
14
test/unit/effects.js
vendored
@ -1785,4 +1785,18 @@ asyncTest("Animation callbacks (#11797)", 15, function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test( "Animate properly sets overflow hidden when animating width/height (#12117)", 4, function() {
|
||||||
|
jQuery.each( [ "height", "width" ], function( _, prop ) {
|
||||||
|
jQuery.each( [ 100, 0 ], function( _, value ) {
|
||||||
|
var div = jQuery("<div>"),
|
||||||
|
props = {};
|
||||||
|
props[ prop ] = value;
|
||||||
|
div.animate( props, 1 );
|
||||||
|
equal( div.css( "overflow" ), "hidden",
|
||||||
|
"overflow: hidden set when animating " + prop + " to " + value );
|
||||||
|
div.stop();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
} // if ( jQuery.fx )
|
} // if ( jQuery.fx )
|
||||||
|
Loading…
Reference in New Issue
Block a user