Skip to main content

Bug Tracker

Side navigation

#5051 closed bug (worksforme)

Opened August 14, 2009 01:37PM UTC

Closed November 19, 2010 03:53AM UTC

Last modified March 15, 2012 11:26AM UTC

jQuery.animate problem (IE 6/7/8) on style.left with negative em position values

Reported by: tr1x Owned by:
Priority: major Milestone: 1.4
Component: effects Version: 1.3.2
Keywords: animate, em Cc:
Blocked by: Blocking:

i think i've found a bug in the jQuery.animate() function in IE 6/7/8 with negative "em" position values.

in the attached file you can see this problem.

if you are animating an object from left to right or from right to left from an position >0em there is everything ok. but if you try to animate the object to a negative value in IE 6/7/8 with "em" values (in my example: -=5em) it doesent work. the objects jumps back.

i've found out that if the position unit != "px" and the position < 0em the calculations from "em" to "px" is wrong.

(with the unit "px" everything works fine)

maybe i'm wrong and this is a generaly problem on ie. i hope someone can find a solution.

(: sorry for my english :)

Attachments (1)
  • animBug.html (1.0 KB) - added by tr1x August 14, 2009 01:38PM UTC.

    jQuery.animate() bug on IE6/7/8

Change History (3)

Changed August 17, 2009 09:53AM UTC by tr1x comment:1

i've found an solution. after debugging the jQuery.animate() a hundred times in IE :) i've found out that IE gets a floating point number if for example the unit is 'em' and the value is negative (e.g. -5em).

so the hack by Dean Edwars doesn't match the ret value. I've modified The Line 829 in Version 1.3.2 from:

if ( !/^\\d+(px)?$/i.test( ret ) && /^\\d/.test( ret ) ) {


if ( !/^\\d+(.\\d*)+(px)?$/i.test( ret ) && /^\\d+(.\\d*)/.test( ret ) ) {

Now it is possible to convert floating point values to px :)

that's it. i hope i can get a fast response to this issiue.

Changed June 13, 2010 04:21PM UTC by dmethvin comment:2

component: unfiledfx
need: ReviewCommit

Looks like a good fix.

Changed November 19, 2010 03:53AM UTC by snover comment:3

resolution: → worksforme
status: newclosed

Seems to work in current versions of jQuery. test case