CSS3 animation-play-state 属性

实例

暂停动画:

div
{
animation-play-state:paused;
-webkit-animation-play-state:paused; /* Safari 和 Chrome */
}

亲自试一试

浏览器支持

Internet Explorer 10、Firefox 以及 Opera 支持 animation-play-state 属性。

Safari 和 Chrome 支持替代的 -webkit-animation-play-state 属性。

注释:Internet Explorer 9 以及更早的版本不支持 animation-play-state 属性。

定义和用法

animation-play-state 属性规定动画正在运行还是暂停。

注释:您可以在 JavaScript 中使用该属性,这样就能在播放过程中暂停动画。

默认值:running
继承性:no
版本:CSS3
JavaScript 语法:object.style.animationPlayState="paused"

语法

animation-play-state: paused|running;
描述测试
paused规定动画已暂停。测试
running规定动画正在播放。测试

相关页面

CSS3 教程:CSS3 动画