如何从开始到开头运行功能



我写了一个动画,该动画在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);

最新更新