Ah, I hadn't realized these were IE-only properties.

The basic problem still remains that the animate method cannot take a dual
property.  You would have to write a custom handler for the
backgroundPosition attribute.  I suggest taking a look at Stefan's ifx.js
script in the Interface plugin.  He wrote some custom functionality for the
animate method that could accommodate interpolating colors.  Something
similar to this could be done for backgroundPosition.

JK

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of sspboyd
Sent: Thursday, April 19, 2007 5:51 PM
To: jQuery (English)
Subject: [jQuery] Re: animate background-position??


Yeah, I thought that might be it but unfortunately it is not. There is
no "backgroundPositionX" or "backgroundPositionY".
http://www.w3.org/TR/CSS2/colors.html#background-properties

There is however "background-position-x" but that property is a
Microsoft extension.
http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/backgro
undpositionx.asp

On Apr 19, 5:55 pm, "Jeffrey Kretz" <[EMAIL PROTECTED]> wrote:
> Background-position is a dual property, containing both the X and Y
> coordinates.  To animate it, you have to animate the X and Y separately.
>
> $('#header').animate({backgroundPositionX : bkgPosX , backgroundPositionY:
> bkgPosY },'slow');
>
> JK
>
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] On
>
> Behalf Of sspboyd
> Sent: Thursday, April 19, 2007 2:35 PM
> To: jQuery (English)
> Subject: [jQuery] animate background-position??
>
> Hi,
> I've been trying several ways to animate the position of a background
> image and I'm stuck.
>
> This is the code I'm using:
>
> $("#header").click(function(){
>         var bkgPosX=Math.round(Math.random()*(-500));
>         var bkgPosY=Math.round(Math.random()*(-200));
>
>         $("#header").animate({style: 'background-position: bkgPosX
> bkgPosY;'},'slow');
>         });
>
> Any help is much appreciated!
> Steve


Reply via email to