Bug Tracker

Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#5051 closed bug (worksforme)

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:

Description

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 (1014 bytes) - added by tr1x 10 years ago.
jQuery.animate() bug on IE6/7/8

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by tr1x

Attachment: animBug.html added

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

comment:1 Changed 10 years ago by tr1x

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 ) ) {

to

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.

comment:2 Changed 9 years ago by dmethvin

Component: unfiledfx
need: ReviewCommit

Looks like a good fix.

comment:3 Changed 9 years ago by snover

Resolution: worksforme
Status: newclosed

Seems to work in current versions of jQuery. test case

Note: See TracTickets for help on using tickets.