Ticket #8160 (closed bug: duplicate)
jQuery animate() regression since v1.5
| Reported by: | jon301@… | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.5.1 |
| Component: | effects | Version: | 1.5 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
jQuery animate() function does not support some CSS properties since v1.5
Example with "backgroundPosition" property : $('#container').animate({backgroundPosition: '160px 50%'}, 1000);
Working with 1.4.4 (and older) http://jsfiddle.net/8CzvY/
Not working with 1.5 http://jsfiddle.net/8CzvY/1/
Is it a bug or is it not supported anymore ?
Thank you
Jon
Change History
comment:2 Changed 2 years ago by jitter
- Keywords needsreview added
- Priority changed from undecided to high
- Status changed from new to open
- Milestone changed from 1.next to 1.5.1
Thanks for taking the time to contribute to the jQuery project by writing a bug report and providing a test case!
You already resolved this ticket all by yourself with the comment. The part of the documentation you quoted applies directly to this ticket. As backgroundPosition isn't a property with a single numeric value.
So this is basically a dupe of #7755 . You might want to look at my response there for a possible solution.
The reason I keep this ticket open is that this looks like a strange regression from 1.4.4 to 1.5, as there weren't that many changes to the css/animate related code afaik. So we should check what caused this to make sure we didn't break something else which IS supported.
comment:4 Changed 2 years ago by jitter
- Component changed from unfiled to effects
This got introduced by the fix for #7736 which made the "single numeric value" check for animation more strict (hint: rfxnum).
So the cause for your problems is the above mentioned fix which makes animate actually behave as the documentation describes more strictly.
This change also affects e.g. the bgpos-hook of the jQuery-cssHooks plugin.
comment:6 Changed 2 years ago by snover
- Status changed from open to closed
- Resolution set to invalid
Thanks for the report, but this is not a jQuery bug. The fact that this ever worked was coincidental; animating multi-value properties like background-position was never supported by default.
comment:7 Changed 2 years ago by jitter
- Keywords needsreview removed
- Priority changed from high to low
- Status changed from closed to reopened
- Resolution invalid deleted
comment:8 Changed 2 years ago by jitter
- Status changed from reopened to closed
- Resolution set to duplicate
comment:10 follow-up: ↓ 14 Changed 2 years ago by zachstronaut
Support for animating background-position has been a part of jQuery animate (whether intentional or not) for at least all of 1.2.x, all of 1.3.x, and all of 1.4.x. I find it very unacceptable that this was broken in 1.5.x, that the unit tests did not catch this, and then when it was reported as a bug the response was "this was never intentionally supported, so this is not a bug."
Please reopen this bug report, and fix this issue.
comment:11 Changed 2 years ago by timmywil
#9108 is a duplicate of this ticket.
comment:12 Changed 2 years ago by timmywil
#9160 is a duplicate of this ticket.
comment:13 Changed 2 years ago by timmywil
#9194 is a duplicate of this ticket.
comment:14 in reply to: ↑ 10 Changed 2 years ago by anonymous
Replying to zachstronaut:
Support for animating background-position has been a part of jQuery animate (whether intentional or not) for at least all of 1.2.x, all of 1.3.x, and all of 1.4.x. I find it very unacceptable that this was broken in 1.5.x, that the unit tests did not catch this, and then when it was reported as a bug the response was "this was never intentionally supported, so this is not a bug."
Please reopen this bug report, and fix this issue.
Absolutely my opinion, I have a script I use regularly which is not working with jQuery >1.5...it uses the animation of the backgroundPosition proprety for a nice hover effect...you just can't take out a "feature" (as said above, whether intentional or not) out that was "ever" there...
comment:15 Changed 2 years ago by timmywil
#9350 is a duplicate of this ticket.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

According to the documentation :
"All animated properties should be animated to a single numeric value, except as noted below; most properties that are non-numeric cannot be animated using basic jQuery functionality. (For example, width, height, or left can be animated but background-color cannot be.)"
Maybe it is new since 1.5 ?
Jon