Skip to main content

Bug Tracker

Side navigation

#13855 closed bug (fixed)

Opened May 05, 2013 01:23AM UTC

Closed May 06, 2013 04:29PM UTC

Last modified May 18, 2013 09:13PM UTC

Problems animating line-height property

Reported by: gpothier@gmail.com 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:

$.cssNumber['lineHeight'] = false;

Attachments (0)
Change History (4)

Changed May 06, 2013 04:29PM UTC by timmywil comment:1

resolution: → duplicate
status: newclosed

Duplicate of #13472.A ticket is open to document cssNumber.

https://github.com/jquery/api.jquery.com/issues/164

Changed May 14, 2013 12:38AM UTC by Richard Gibson comment:2

resolution: duplicatefixed

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

Changeset: 3971c2ebb2e6729fe80bac4ee7b91bc02f26486f

Changed May 14, 2013 12:39AM UTC by gibson042 comment:3

milestone: None2.0.1

Changed May 18, 2013 09:13PM UTC by dmethvin comment:4

component: unfiledeffects
priority: undecidedlow