Ticket #8190 (closed bug: duplicate)
Regression with chaining multiple delay + animation calls
| Reported by: | cnanney | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | 1.5.1 |
| Component: | effects | Version: | 1.5 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
In upgrading to 1.5, my flip counter script stopped working. I've created a test case here:
http://jsfiddle.net/cnanney/3QsYY/
You can see the animation works in 1.4.4, but when you switch to 1.5 and run it, nothing happens.
Change History
comment:2 Changed 2 years ago by rwaldron
- Priority changed from undecided to high
- Status changed from new to open
- Component changed from unfiled to effects
Confirmed - but you're second "reduced" test doesn't work at all.
comment:3 Changed 2 years ago by cnanney
The second example was only one frame of the animation, which was kind of hard to see, but you'll notice the top of the digit has started to fall. This one is easier to see: http://jsfiddle.net/cnanney/3QsYY/2/
comment:4 Changed 2 years ago by jitter
- Status changed from open to closed
- Resolution set to duplicate
- Milestone changed from 1.next to 1.5.1
This isn't a bug. The animate() documentation reads:
All animated properties should be animated to a single numeric value
background-position isn't a property that consists of a single numeric value.
comment:6 follow-up: ↓ 7 Changed 2 years ago by cnanney
@jitter, thanks for the quick response. Fixed by separating into backgroundPositionX and Y animations.
comment:7 in reply to: ↑ 6 Changed 2 years ago by jitter
Replying to cnanney:
@jitter, thanks for the quick response. Fixed by separating into backgroundPositionX and Y animations.
np. But you might need to be careful there as (afaik) not all browsers support backgroundPositionX/Y .
comment:8 Changed 2 years ago by cnanney
You're right... works fine on Webkit and IE, but not Firefox and Opera. Of course.
So jQuery lost the ability to animate background positions without the use of an external plugin (cssHooks)? Interesting.
comment:9 Changed 2 years ago by dmethvin
If the background-position animation worked at any point, it was by luck and not by design. The docs have always said that "All animated properties should be animated to a single numeric value."
comment:10 Changed 2 years ago by cnanney
Thanks for all the information. In my situation using animate() in this way wasn't even the most efficient solution anyway.
However, I did notice some strange behavior with regards to background-position animation: When supplying two values with 'px' (20px 30px), it worked in all browsers in 1.4.4, and none in 1.5. But when only the first has px (20px 30), it is the opposite, works in 1.5, but not for 1.4.4:
http://jsfiddle.net/cnanney/3QsYY/5/
The change in the rfxnum regex doesn't seem to support this change in behavior. I guess if it was never officially supported anyway, I'm glad to have stopped using it. Thanks again.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

I've reduced this further to a single frame of animation:
http://jsfiddle.net/cnanney/3QsYY/1/
Works in 1.4.4, not in 1.5. Seems an animation will not fire if chained to a delay.