Toggle navigation

CSS animation-play-state 属性

实例

暂停动画:

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

试一试

浏览器支持

表格中的数字注明了完全支持该属性的首个浏览器版本。

带 -webkit-、-moz- 或 -o- 的数字表示使用前缀的首个版本。

属性ChromeIEFirefoxSafariOpera
animation-play-state43.0
4.0 -webkit-
10.016.0
5.0 -moz-
9.0
4.0 -webkit-
30.0
15.0 -webkit-
12.0 -o-

定义和用法

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

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

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

语法

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

相关页面

CSS3 教程:CSS3 动画