我有一个包含带动画的 div 的页面,我想在按钮单击或使用 jquery 之类的情况后重新启动此动画有没有办法做到这一点? 这是我的代码:
<div class="block bg-1 network-effect" style="max-height:500px;" id="okd">
<canvas id="network"></canvas>
<div class="container1">
<h2 class="h-lg text-center">All Computer <span class="color">& Tablet Services</span></h2>
<p class="info text-center">We can Solve your Hardware and Software Problems</p>
<div class="row text-icon-carousel" id="counterBlock">
<div class="col-sm-6 col-md-3">
<div class="text-icon" data-animation="scaleOut" data-animation-delay="0.5s">
<div class="icon-wrapper"><span><i class="icon icon-diag"></i><span class="icon-hover"></span></span>
</div>
<h3 class="number"><span id="ok1" data-to="8000" data-speed="1000">8000</span>+</h3>
<p class="text">Computer/Tablet/Laptop
<br>Repaired</p>
</div>
</div>
</div>
</div>
</div>
最佳答案
如果你想让动画在有人点击按钮时发生,你会想做这样的事情
$("selector").click(function(){
$("selector1").animate({animation});
});
只需将“selector”替换为您想要点击的内容,将“selector1”替换为您想要动画的内容,将“animation”替换为您想要动画执行的内容。
关于jquery - 使用 jquery 重新启动条件后的动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45744358/