2016-12-16 65 views
2

我写了一个动画,它是在jquery中的一个按钮上弹出后开始的。现在我想从头到尾运行这个动画。这是可能的jQuery中,或者我必须再次写这个动画,但这次正反面?我的意思是只是一个后台功能,重现每一步,最后看起来像点击任何事情之前。如何从头到尾运行功能?

$("#three").click(function() { 
    $("#two, #four, #five, #six").addClass("animated out"); 
    $("#seven").addClass("show"); 
    $("#three").addClass("animated totheleft"); 
    $("#mytext").addClass("animated totheright"); 
    setTimeout(function(){$("#mytext").addClass("hide");},2000); 
}); 
+0

通过你失望写了这个问题,并提交的时间的话,你可能已经通过手动现做的。 ; D – Smuuf

回答

0
setTimeout(function(){ 
$("#two, #four, #five, #six").removeClass("animated out"); 
$("#seven").removeClass("show"); 
... so on 
},2000); 
+0

但是,这个你写的不会重新创建动画(动画出来)只是再次显示我的对象。 – unknown2549

+0

当您使用setTimeout方法时,您可以使用向后动画调用另一个函数。 –

+0

但我不想写这个函数正面。 – unknown2549