Bug Tracker

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#10780 closed bug (duplicate)

.animate() does not work correctly for percentages

Reported by: egonzalez0787 Owned by:
Priority: undecided Milestone: None
Component: effects Version: 1.7
Keywords: Cc:
Blocked by: Blocking:

Description

If I have this:

<div id="outer">
  <div id="inner">
  </div>
</div>

With this css:

div#outer {
  height: 200px;
  width: 120px;
}
div#inner {
  height: 0;
  width: 100%;
}

And try to do this:

$('div#inner').animate({height: '100%'});

When the animation is finished, what I get is a '100px' height instead of the '100%' expected. This works fine in version 1.6.4 and 1.6.3.

My workaround for 1.7 was something like this:

$('div#inner').animate({height: $('div#outer').height() + 'px'});

Change History (2)

comment:1 Changed 6 years ago by timmywil

Component: unfiledeffects
Resolution: duplicate
Status: newclosed

comment:2 Changed 6 years ago by timmywil

Duplicate of #10669.

Note: See TracTickets for help on using tickets.