我编写了一个动画,该动画在单击 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);
});
最佳答案
setTimeout(function(){
$( "#two, #four, #five, #six" ).removeClass( "animated out" );
$( "#seven" ).removeClass( "show" );
... so on
},2000);
关于jquery - 如何从头到尾运行函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41190654/