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/backgroundpositionx.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: jquery-en@googlegroups.com [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