i have a problem with this code and i cant't find the problem. It works with JQuery 1.5.2 and lower, but not with JQuery 1.6 and higher.
Here is the code and thanks for your help!
$(document).ready(function () {
$(".selected").stop().animate({'backgroundPosition':'(0 -28)'}, {duration:200});
$('#ver li a').hover(
function ()
{
if (!($(this).hasClass("selected")))
{
height = $(this).height() * (1);
$(this).stop().animate({'backgroundPosition':'(0 ' + -height + ')'}, {duration:200});
}
},
function ()
{
if (!($(this).hasClass("selected")))
{
$(this).stop().animate({'backgroundPosition':'(0 0)'}, {duration:200});
}
}
);
});
I ran into a similar problem, but in my case I was animating just the X axis of the background using something like "backgroundPosition: '+=1350px 0px'", for some reason this stopped working once I went to jQuery 1.6.2... All my other animate instances were working fine, on the same block.
In the end (after a long debug session), I noticed that if I removed the Y-Axis value from the call, it worked. so "backgroundPosition: '+=1350px 0px'" doesnt work anymore, but "backgroundPosition: '+=1350px'" works. The odd thing is that it doesnt even throw an error at you, the animate does process, but nothing happens (so, no error). As of now, I cant figure a way to animate a background image on the Y axis.