所以我所拥有的是一个大图像,当有人在页面上时,我试图连续制作动画
我现在要做的是:
$('.photobanner').animate({
backgroundPosition:"(-10000px 0px)"
}, 80000, 'linear');
这有效..但它似乎结束并停止..我可以无限做同样的动画吗?
现在它工作了----
var counter=0;
function moveBG(y)
{
counter=counter-1000;
$('.photobanner').animate({ backgroundPosition:"("+counter+"px 0px)" }, 8000, 'linear',moveBG);
}
我定义了一个计数器,它将递增到无穷大并使用了这个函数。