Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#10669 closed bug (fixed)

.animate() no longer animates percentage(%) width

Reported by: rudeboiidevil2k7@… Owned by:
Priority: high Milestone: 1.7.1
Component: effects Version: 1.7
Keywords: Cc:
Blocked by: Blocking:

Description

As of jQuery 1.6.4, the animate of using -=<percentage>% works just fine, but in jQuery 1.7, this fails to do so and animates in pixels.

$('div').animate({ width: '-=5%' });

If you test this in jQuery 1.6.4 with jsFiddle, if you inspect the element with Firebug it will show the width is in %.

Test: http://jsfiddle.net/HUfzX/


With jQuery 1.7 it animates with pixels, when inspecting the element, it shows the width in pixels not %

Test: http://jsfiddle.net/sWjXr/

Change History (15)

comment:1 Changed 12 years ago by anonymous

This test was taken in Firefox 7 with Mac OS X 10.7.2.

comment:2 Changed 12 years ago by anonymous

On Chrome, with 1.6.4 it works correctly, but with 1.7 it seems to use 40px instead of 40%, and as a result the width becomes 40 * 0.95 px.

comment:3 Changed 12 years ago by Timmy Willison

Component: unfiledeffects
Milestone: None1.7.1
Priority: undecidedhigh
Status: newopen
Summary: .animate() no longer animates % width.animate() no longer animates percentage(%) width

comment:4 Changed 12 years ago by Timmy Willison

#10681 is a duplicate of this ticket.

comment:5 Changed 12 years ago by Timmy Willison

#10684 is a duplicate of this ticket.

comment:6 Changed 12 years ago by nadim@…

I can confirm this bug also occurred in my own webapp when tested on Chrome 15 and Chrome 16 beta on Mac OS X 10.7.2.

comment:7 Changed 12 years ago by dcz@…

Btw, the -/+= is not needed to loose the % :

http://jsfiddle.net/sWjXr/1/

Asked for 55%, got 55px on FF 7.0.1

comment:8 Changed 12 years ago by anonymous

The issue is at jquery-1.7.js:8893

jQuery.style( fx.elem, prop, Math.max(0, fx.now) );

should be

jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit);

comment:9 Changed 12 years ago by Timmy Willison

Resolution: fixed
Status: openclosed

Add back unit in the width/height step function. Fixes #10669.

Changeset: 1e677f30f68d8ea41261aa666a9ba0720383e9d0

comment:10 Changed 12 years ago by dmethvin

#10713 is a duplicate of this ticket.

comment:11 Changed 12 years ago by dmethvin

#10716 is a duplicate of this ticket.

comment:12 Changed 12 years ago by dmethvin

#10775 is a duplicate of this ticket.

comment:13 Changed 12 years ago by Timmy Willison

#10780 is a duplicate of this ticket.

comment:14 Changed 12 years ago by Timmy Willison

#10795 is a duplicate of this ticket.

comment:15 Changed 12 years ago by Timmy Willison

#10857 is a duplicate of this ticket.

Note: See TracTickets for help on using tickets.