【发布时间】:2013-08-21 15:01:55
【问题描述】:
我有一个动画(带有背景图像的div),它有另一个动画作为回调。
汽车从右向左行驶,然后转身返回。都有一些延迟。我希望整个动画再次无限次运行。
代码如下:
var tempoPolente = 10000;
var viewport = $(window).width() + 300;
// Animation
var polenteAnim = function() {
$("#polente").removeClass('flip').animate({"right": "+="+viewport}, tempoPolente, 'linear',
function() {
setTimeout(function() {
$("#polente").addClass("flip").animate({"right": "-="+viewport}, tempoPolente, 'linear');
}, 1000);
});
};
【问题讨论】:
标签: jquery animation jquery-animate