mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Fix #12846. Restore overflow when animation is stopped.
This commit is contained in:
parent
b594673a42
commit
a6c358d046
2
src/effects.js
vendored
2
src/effects.js
vendored
@ -295,7 +295,7 @@ function defaultPrefilter( elem, props, opts ) {
|
|||||||
|
|
||||||
if ( opts.overflow ) {
|
if ( opts.overflow ) {
|
||||||
style.overflow = "hidden";
|
style.overflow = "hidden";
|
||||||
anim.done(function() {
|
anim.always(function() {
|
||||||
style.overflow = opts.overflow[ 0 ];
|
style.overflow = opts.overflow[ 0 ];
|
||||||
style.overflowX = opts.overflow[ 1 ];
|
style.overflowX = opts.overflow[ 1 ];
|
||||||
style.overflowY = opts.overflow[ 2 ];
|
style.overflowY = opts.overflow[ 2 ];
|
||||||
|
6
test/unit/effects.js
vendored
6
test/unit/effects.js
vendored
@ -1758,16 +1758,18 @@ asyncTest("Animation callbacks (#11797)", 15, function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test( "Animate properly sets overflow hidden when animating width/height (#12117)", 4, function() {
|
test( "Animate properly sets overflow hidden when animating width/height (#12117)", 8, function() {
|
||||||
jQuery.each( [ "height", "width" ], function( _, prop ) {
|
jQuery.each( [ "height", "width" ], function( _, prop ) {
|
||||||
jQuery.each( [ 100, 0 ], function( _, value ) {
|
jQuery.each( [ 100, 0 ], function( _, value ) {
|
||||||
var div = jQuery("<div>"),
|
var div = jQuery("<div>").css( "overflow", "auto" ),
|
||||||
props = {};
|
props = {};
|
||||||
props[ prop ] = value;
|
props[ prop ] = value;
|
||||||
div.animate( props, 1 );
|
div.animate( props, 1 );
|
||||||
equal( div.css( "overflow" ), "hidden",
|
equal( div.css( "overflow" ), "hidden",
|
||||||
"overflow: hidden set when animating " + prop + " to " + value );
|
"overflow: hidden set when animating " + prop + " to " + value );
|
||||||
div.stop();
|
div.stop();
|
||||||
|
equal( div.css( "overflow" ), "auto",
|
||||||
|
"overflow: auto restored after animating " + prop + " to " + value );
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user