网站开发的条件,小程序界面设计模板,网站发帖功能怎么做,加速器推荐animation 动画属性介绍 animation 属性是一个简写属性#xff0c;用于设置动画属性#xff1a; 1. animation-name----规定需要绑定到选择器的 keyframe 名称。 语法#xff1a;animation-name: keyframename|none#xff1b; Keyframename#xff1a;规定需要绑定到选择…animation 动画属性介绍 animation 属性是一个简写属性用于设置动画属性 1. animation-name----规定需要绑定到选择器的 keyframe 名称。 语法animation-name: keyframename|none Keyframename规定需要绑定到选择器的 keyframe 的名称。 None 规定无动画效果可用于覆盖来自级联的动画。 例如 { -webkit-animation-name: my_animation; -moz-animation-namemy_animation; -ms-animation-namemy_animation; -o-animation-name: my_animation; animation-name: my_animation; } -webkit-keyframes my_animation{} -moz-keyframes my_animation{} -ms-keyframes my_animation{} -o-keyframes my_animation{} keyframes my_animation{} 2. animation-duration----规定完成动画所花费的时间以秒或毫秒计。 语法animation-duration: time; time 规定完成动画所花费的时间。默认值是 0意味着没有动画效果。 例如 { -webkit-animation-duration: 2s; -moz-animation-duration2s; -ms-animation-duration2s; -o-animation-duration: 2s; animation--duration: 2s; } 3. animation-timing-function----规定动画的速度曲线 语法animation-timing-function: value; Value值: linear动画从头到尾的速度是相同的。 ease默认。动画以低速开始然后加快在结束前变慢。 ease-in动画以低速开始。 ease-out 动画以低速结束。 ease-in-out动画以低速开始和结束。 cubic-bezier(n,n,n,n)在 cubic-bezier 函数中自己的值。可能的值是从 0 到 1 的数值。 例如 {animation-timing-function:linear;} {animation-timing-function:ease;} {animation-timing-function:ease-in;} {animation-timing-function:ease-out;} {animation-timing-function:ease-in-out;} 4. animation-delay----规定在动画开始之前的延迟 语法animation-delay: time; Time值可选。定义动画开始前等待的时间以秒或毫秒计。默认值是 0。允许负值-2s 使动画马上开始但跳过 2 秒进入动画。 { animation-delay:2s; -webkit-animation-delay:2s; } 5. animation-iteration-count----规定动画应该播放的次数 语法animation-iteration-count: n|infinite; n定义动画播放次数的数值。 infinite规定动画应该无限次播放。默认值为1。 示例 { animation-iteration-count:infinite; -webkit-animation-iteration-count:infinite; } 6. animation-direction----规定是否应该轮流反向播放动画 语法animation-direction: normal|alternate; normal默认值。动画应该正常播放。 alternate 动画应该轮流反向播放。 注释如果把动画设置为只播放一次则该属性没有效果。 示例 { animation-direction:alternate; -webkit-animation-direction:alternate; } 7. animation-play-state 属性规定动画正在运行还是暂停 语法animation-play-state: paused|running; paused规定动画已暂停。 running规定动画正在播放。 注释可以在 JavaScript 中使用该属性这样就能在播放过程中暂停动画。 示例 { animation-play-state:running; -webkit-animation-play-state:running; } 8. animation-fill-mode 属性规定动画在播放之前或之后其动画效果是否可见 语法animation-fill-mode : none | forwards | backwards | both; none不改变默认行为。 forwards 当动画完成后保持最后一个属性值在最后一个关键帧中定义。 backwards在 animation-delay 所指定的一段时间内在动画显示之前应用开始属性值在第一个关键帧中定义。 both 向前和向后填充模式都被应用。转载于:https://www.cnblogs.com/wuph/p/4502644.html