js 让动画暂停
作者:
轩辕夜空 | 来源:发表于
2021-12-25 08:29 被阅读0次
html
<img src="../images/tagbg.png" id="xuanzhuan" class="xuanzhuan tagbg" alt="">
js
setTimeout(() => {
document.getElementById('xuanzhuan').style.animationPlayState = 'paused'
}, 1000)
css
.xuanzhuan {
animation: rotate 5s linear infinite;
//animation-iteration-count: 0.5;
}
@keyframes rotate {
0% {
transform: rotateZ(0deg); /*从0度开始*/
}
100% {
transform: rotateZ(360deg); /*360度结束*/
}
}
本文标题:js 让动画暂停
本文链接:https://www.haomeiwen.com/subject/geqdqrtx.html
网友评论