下面是一个例子,具体的需要你自己慢慢学习。
本例在 Internet Explorer 中无效。
实例
使用简写属性,将动画与 div 元素绑定:
div
{
animation:mymove 5s infinite;
-webkit-animation:mymove 5s infinite; /* Safari 和 Chrome */
}
定义和用法
animation 属性是一个简写属性,用于设置六个动画属性:
animation-name
animation-duration
animation-timing-function
animation-delay
animation-iteration-count
animation-direction
注释:请始终规定 animation-duration 属性,否则时长为 0,就不会播放动画了。
默认值:none 0 ease 0 1 normal
继承性:no
版本:CSS3
JavaScript 语法:object.style.animation="mymove 5s infinite"