本文摘自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属性怎么用的详细内容,更多文章请关注木庄网络博客!
相关阅读 >>
什么是对html的补充,可以使网页形式和内容分离?
css能做什么
css里上下居中怎么弄?
使用html和css的新特性实现响应式布局
详解css行内样式、内嵌样式与外部引用样式的使用方法
css怎么去掉div边框
css如何禁止a标签跳转
css选择器的分类有哪些
css中inline-block什么意思
css字体样式属性有哪些
更多相关阅读请进入《css》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » css animation-play-state属性怎么用