【发布时间】:2019-02-24 09:14:30
【问题描述】:
我有这个动画,我希望它无限重复,但是当有人点击它时我希望它停止并且不再开始,有什么办法吗?谢谢!
HTML:
<div class="container">
<a class="carousel-control-prev mr-5" href="#carouselExampleIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<div class="clickme bounceIn d-flex flex-column">click me</div>
<a class="carousel-control-next bounceIn" href="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
CSS:
.bounceIn {
-webkit-animation-duration: 0.75s;
animation-duration: 0.75s;
-webkit-animation-name: bounceIn;
animation-name: bounceIn;
animation-delay: 5s;
-webkit-animation-iteration-count: infinite;
}
【问题讨论】:
-
只需单击一下即可删除此类?
-
animation属性的浏览器前缀在 CSS 中不是必需的
标签: javascript html css animation