#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)
Change History (4)
Changed 13 years ago by
Attachment: | animBug.html added |
---|
comment:1 Changed 13 years ago by
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 13 years ago by
Component: | unfiled → fx |
---|---|
need: | Review → Commit |
Looks like a good fix.
comment:3 Changed 12 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Seems to work in current versions of jQuery. test case
jQuery.animate() bug on IE6/7/8