animation-play-state属性怎么用
导读: CSS3animation-play-state属性 作用:animation-play-state属性规定动画正在运行还是暂停。 语法: animation-play-state:paused|running; ...
CSS3animation-play-state属性
作用:animation-play-state属性规定动画正在运行还是暂停。
语法:
animation-play-state:paused|running;
paused:规定动画已暂停。
running:规定动画正在播放。
说明:您可以在JavaScript中使用该属性,这样就能在播放过程中暂停动画。
注:InternetExplorer9以及更早的版本不支持animation-play-state属性。
CSS3animation-play-state属性的使用示例
div
{
width:100px;
height:100px;
background:red;
position:relative;
animation:mymove5s;
animation-play-state:running;
/*SafariandChrome*/
-webkit-animation:mymove5s;
-webkit-animation-play-state:running;
}
div:hover{
animation-play-state:paused;
-webkit-animation-play-state:paused;
}
@keyframesmymove
{
from{
left:0px;
}
to{
left:200px;
}
}
@-webkit-keyframesmymove/*SafariandChrome*/
{
from{
left:0px;
}
to{
left:200px;
}
}
本文转载自中文网
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: animation-play-state属性怎么用
本文地址: https://pptw.com/jishu/665087.html
