mirror of
https://github.com/jquery/jquery.git
synced 2026-01-24 19:48:06 -05:00
Fix #13855: line-height animations. Close gh-1265.
(cherry picked from commit 3971c2ebb2)
This commit is contained in:
38
test/unit/effects.js
vendored
38
test/unit/effects.js
vendored
@@ -1405,6 +1405,44 @@ test("Do not append px to 'fill-opacity' #9548", 1, function() {
|
||||
});
|
||||
});
|
||||
|
||||
test("line-height animates correctly (#13855)", function() {
|
||||
expect( 12 );
|
||||
stop();
|
||||
|
||||
var
|
||||
animated = jQuery(
|
||||
"<p style='line-height: 4;'>unitless</p>" +
|
||||
"<p style='line-height: 50px;'>px</p>" +
|
||||
"<p style='line-height: 420%;'>percent</p>" +
|
||||
"<p style='line-height: 2.5em;'>em</p>"
|
||||
).appendTo("#qunit-fixture"),
|
||||
initialHeight = jQuery.map( animated, function( el ) {
|
||||
return jQuery( el ).height();
|
||||
});
|
||||
|
||||
animated.animate( { "line-height": "hide" }, 1500 );
|
||||
setTimeout(function() {
|
||||
animated.each(function( i ) {
|
||||
var label = jQuery.text( this ),
|
||||
initial = initialHeight[ i ],
|
||||
height = jQuery( this ).height();
|
||||
ok( height < initial, "hide " + label + ": upper bound" );
|
||||
ok( height > initial / 2, "hide " + label + ": lower bound" );
|
||||
});
|
||||
animated.stop( true, true ).hide().animate( { "line-height": "show" }, 1500 );
|
||||
setTimeout(function() {
|
||||
animated.each(function( i ) {
|
||||
var label = jQuery.text( this ),
|
||||
initial = initialHeight[ i ],
|
||||
height = jQuery( this ).height();
|
||||
ok( height < initial / 2, "show " + label + ": upper bound" );
|
||||
});
|
||||
animated.stop( true, true );
|
||||
start();
|
||||
}, 400 );
|
||||
}, 400 );
|
||||
});
|
||||
|
||||
// Start 1.8 Animation tests
|
||||
asyncTest( "jQuery.Animation( object, props, opts )", 4, function() {
|
||||
var animation,
|
||||
|
||||
Reference in New Issue
Block a user