0
我想在jquery中使用.setInterval()
和.animate()
函数给jQuery图像动画。我的代码如下:我们可以在setInterval函数中自动暂停animate()和resume()吗?
$(document).ready(function(){
setInterval(function(){
$("#animate1").fadeIn('slow').animate({'margin-left':'220px','margin-bottom':'20px'},2000,function(){
$('.1st').animate({'opacity':'0'},1000,function(){$('.1st').animate({'opacity':'1'}) })
}).fadeOut();
$("#animate1").fadeIn('slow').animate({'margin-bottom':'0px','margin-left':'-140px'},2000).fadeOut('slow');
},2000);
});
现在,我想给动画$("#animate2")
但在此之前它开始我想是$("#aniamte1")
被停止或暂停。所以,赶上$("#animate1")
,我想要停止/暂停和运行$("#animate2")
,并在完成后我再次$("#animate2")
我想暂停/停止并运行$("#animate1")
。我们怎么做到这一点?
谢谢.. !! fatel ..它的作品..只有你需要添加}); – Maulik
太棒了!我添加了缺失的括号。 :) – fatel