jquery - 使用 jquery 重新启动条件后的动画

标签 jquery html css

我有一个包含带动画的 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/

相关文章:

jquery - jqPlot - 无法将 x 轴显示为右侧图例

Jquery URL验证需要包含linkedin.com

javascript - 使用纯 css/html 创建一个 3 圈维恩图

html - 如何使用单元格创建可扩展的集合?

javascript - 一段时间后删除 Ajax 加载程序图像

Jquery 在单击时检查复选框不会检查它

javascript - html li 标签的问题

php - 我的 config.php 有什么问题?

html - DL 中的溢出 - 弹出窗口的尺寸不会自动调整

html - 在 ionic 单选按钮中使用图像单选按钮样式