1

Possible Duplicate:
jquery animate background position

For a animated hover effect I try to set the background-position in the function animate of jQuery. I set my hover in a sprite image, when I try to set background-position in the function animate, it seems te work just with one param of pixels. When I try to set two (x and y), it doesn't work anymore at all.

What works (it sets 109px 50% in my source code):

$('a#twitter').animate({ 
backgroundPosition: '109px',
});

What I want but not works (nothing in my source code):

$('a#twitter').animate({ 
backgroundPosition: '109px 0px',
});

Thanks in advance.

Nicky

Community
  • 1
  • 1
directory
  • 3,093
  • 8
  • 45
  • 85

1 Answers1

1

try this:

$('a#twitter').animate({ 
   background-position-x: '109px',
   background-position-y: '0'
});
Alessandro Minoccheri
  • 35,521
  • 22
  • 122
  • 171