Style animationName 属性

Style 对象参考手册 Style 对象

实例

改变 <div> 元素的 animationName 属性:

document.getElementById("myDIV").style.animationName="myNEWmove";

尝试一下 »

定义和用法

animationName 属性设置或返回 @keyframes 动画的名称。


浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 10、Firefox 和 Opera 支持 animationName 属性。

Safari 和 Chrome 支持另一个可替代该属性的属性,即 WebkitAnimationName 属性。

注意:Internet Explorer 9 及其之前的版本不支持 animationName 属性。


语法

返回 animationName 属性:

object.style.animationName

设置 animationName 属性:

object.style.animationName="none|keyframename|initial|inherit"

属性值

描述
none默认值。规定没有动画(可用于重写来自级联的动画)。
keyframename规定要绑定到选择器的关键帧的名称。
initial设置该属性为它的默认值。请参阅 initial
inherit从父元素继承该属性。请参阅 inherit

技术细节

默认值:none
返回值:字符串,表示元素的 animation-name 属性。
CSS 版本CSS3


相关文章

CSS 参考手册:animation-name 属性


Style 对象参考手册 Style 对象

0 个评论

要回复文章请先登录注册