本文摘自PHP中文网,作者藏色散人,侵删。
css animation-play-state属性规定动画正在运行还是暂停。animation-play-state: paused;表示动画已暂停,animation-play-state: running;表示动画正在播放。
css animation-play-state属性怎么用?
作用:animation-play-state 属性规定动画正在运行还是暂停。
语法:
1 | animation-play-state: paused|running;
|
说明:paused 规定动画已暂停。running 规定动画正在播放。
注释:您可以在 JavaScript 中使用该属性,这样就能在播放过程中暂停动画。
css animation-play-state属性使用示例
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | <!DOCTYPE html>
<html>
<head>
<style>
div
{
width:100px;
height:100px;
background:red;
position:relative;
animation:mymove 5s;
animation-play-state:paused;
-webkit-animation:mymove 5s;
-webkit-animation-play-state:paused;
}
@keyframes mymove
{
from {left:0px;}
to {left:200px;}
}
@-webkit-keyframes mymove
{
from {left:0px;}
to {left:200px;}
}
</style>
</head>
<body>
<p><strong>注释:</strong>Internet Explorer 9 以及更早的版本不支持 animation-play-state 属性。</p>
<div></div>
</body>
</html>
|
效果:

以上就是css animation-play-state属性怎么用的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
css怎么实现对话框
css text-outline属性怎么用
css怎么让div不换行
:empty是什么?怎么使用?
如何使用 css 颜色?
css上下间距怎么设置
css float属性怎么用
css类选择符用什么表示?
css border-right-color属性怎么用
css的背景图怎么加边框
更多相关阅读请进入《css》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » css animation-play-state属性怎么用