Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#7448 closed bug (invalid)

'animate' doesn't work for 'background-position' property in IE6-7

Reported by: [email protected] Owned by:
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:


Since I switched to jquery-1.4.3 the following code stopped working in IE6-7:

       'background-position' : '200px 0'

Now it causes the following error:

Invalid argument. jquery.js line 6573 character 5:
    fx.elem.style[ fx.prop ] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;

At the same time, animation for properties 'background-position-x' and 'background-position-y' seems to be working fine.

Change History (3)

comment:1 Changed 11 years ago by jitter

The documentation for animate states

Shorthand CSS properties (e.g. margin, background, border) are not supported.

Shorthand properties don't work equally across all browsers. For animating background-position in a cross browser way consider using the bgpos-cssHook from jquery-cssHooks

Version 0, edited 11 years ago by jitter (next)

comment:2 Changed 11 years ago by [email protected]

I'm not sure that 'background-position' is a shorthand property, but I found another condition that I missed:

All animated properties should be a single numeric value

comment:3 Changed 11 years ago by snover

Resolution: invalid
Status: newclosed

Thanks for the report, but this is not a jQuery bug. If you want to animate background position, you need to install a plugin that adds support for it.

Note: See TracTickets for help on using tickets.