[jQuery] background position plugin

2009-10-13 Thread vicix
hi, i build a menu with a background position animation plugin by Jonathan Snook’s. The mouseover and mouseout are correct, but i dont't know to put when click to stop animation and dont run a onmouseout action. the code: HTM

[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

[jQuery] jQuery background position plugin

2009-07-10 Thread yo2lux
Hi, The background position plugin by Alexander Farkas rocks!! But I have a question.. Is possible to remove the animation for the X- axis ? For example: $(this).animate({backgroundPosition:"(200px -50px)"}, {duration: 600}) I don't want to animate the X-axis. I don't need 1 2 3 4 200px.. I