Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#13855 closed bug (fixed)

Problems animating line-height property

Reported by: [email protected] Owned by:
Priority: low Milestone: 2.0.1
Component: effects Version: 2.0.0
Keywords: Cc:
Blocked by: Blocking:

Description

I have a table with four rows, whose line-height I want to animate with jQuery. I use the following code to shrink and hide the rows:

$("table tr").animate({ 'line-height': 'hide' }, 5000);

But instead of starting to shrink the rows from their current height, it first makes them really huge, and then starts shrinking. Press the Hide button in this fiddle to see it in action: http://jsfiddle.net/YzCzd/1/

The root of the problem is that jQuery considers line-height a number property, and therefore does not specify the unit when setting the value. It is possible to correctly use hide/show for line-height with the following workaround: $.cssNumberlineHeight? = false;

Change History (4)

comment:1 Changed 10 years ago by Timmy Willison

Resolution: duplicate
Status: newclosed

Duplicate of #13472.
A ticket is open to document cssNumber. https://github.com/jquery/api.jquery.com/issues/164

comment:2 Changed 10 years ago by Richard Gibson

Resolution: duplicatefixed

Fix #13855: line-height animations. Close gh-1265.

Changeset: 3971c2ebb2e6729fe80bac4ee7b91bc02f26486f

comment:3 Changed 10 years ago by gibson042

Milestone: None2.0.1

comment:4 Changed 10 years ago by dmethvin

Component: unfiledeffects
Priority: undecidedlow
Note: See TracTickets for help on using tickets.