[jQuery] Re: jQuery background position plugin

2009-07-11 Thread yo2lux
BTW, I have a quesiton: $(document).ready(function() { $('.buttons a') .mouseover(function() { var index = $('.buttons a').index(this); $(this).css({backgroundPosition: '-' + 200 * index + 'px -0'}) $(this).stop().animate({backgroundPosition:"(-" + 200 * in

[jQuery] Re: jQuery background position plugin

2009-07-11 Thread yo2lux
Thanks so much! I don't really understand the logic behind it. The .css() set the value to 200px but why I need to use the same value in anumate (200px) ? By the way, .css has a bigger priority than animate? Thanks again! I appreciate your help! On Jul 11, 3:51 am, Karl Swedberg wrote: > You co

[jQuery] Re: jQuery background position plugin

2009-07-10 Thread Karl Swedberg
You could chain a .css() to it. Set the x axis first with .css() and then the y axis with .animate() : $(this) .css({backgroundPosition: '200px 0'}) .animate({backgroundPosition:"(200px -50px)"}, {duration: 600}) --Karl Karl Swedberg www.englishrules.com www.learningjquery.c