Skip to main content

Bug Tracker

Side navigation

#8160 closed bug (duplicate)

Opened February 03, 2011 03:25PM UTC

Closed February 07, 2011 11:13PM UTC

Last modified March 13, 2012 04:02PM UTC

jQuery animate() regression since v1.5

Reported by: jon301@gmail.com Owned by:
Priority: low Milestone: 1.5.1
Component: effects Version: 1.5
Keywords: Cc:
Blocked by: Blocking:
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

Attachments (0)
Change History (15)

Changed February 03, 2011 03:32PM UTC by anonymous comment:1

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

Changed February 03, 2011 04:17PM UTC by jitter comment:2

keywords: → needsreview
milestone: 1.next1.5.1
priority: undecidedhigh
status: newopen

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.

Changed February 06, 2011 06:51PM UTC by jitter comment:3

#8189 is a duplicate of this ticket.

Changed February 07, 2011 12:34AM UTC by jitter comment:4

_comment0: This got introduced by the fix for #7736 which made the "single numeric value" check for animation more strict (hint: `rfxnum`). \ \ This change also affects e.g. th bgpos-hook of the [https://github.com/brandonaaron/jquery-cssHooks jQuery-cssHooks plugin].1297039164214261
component: unfiledeffects

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.

Changed February 07, 2011 12:37AM UTC by jitter comment:5

#8190 is a duplicate of this ticket.

Changed February 07, 2011 05:39PM UTC by snover comment:6

resolution: → invalid
status: openclosed

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.

Changed February 07, 2011 11:13PM UTC by jitter comment:7

keywords: needsreview
priority: highlow
resolution: invalid
status: closedreopened

Changed February 07, 2011 11:13PM UTC by jitter comment:8

resolution: → duplicate
status: reopenedclosed

Changed February 07, 2011 11:13PM UTC by jitter comment:9

Duplicate of #7755.

Changed May 04, 2011 04:43PM UTC by zachstronaut comment:10

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.

Changed May 05, 2011 01:20AM UTC by timmywil comment:11

#9108 is a duplicate of this ticket.

Changed May 07, 2011 01:55AM UTC by timmywil comment:12

#9160 is a duplicate of this ticket.

Changed May 09, 2011 04:00PM UTC by timmywil comment:13

#9194 is a duplicate of this ticket.

Changed May 12, 2011 09:01PM UTC by anonymous comment:14

Replying to [comment:10 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...

Changed May 20, 2011 03:31PM UTC by timmywil comment:15

#9350 is a duplicate of this ticket.