web前端CSSkai云体育下载app(官方)最新下载IO庄闲和游戏机S/安卓版/手机版APP3动画效果animation属性
//设置缓动方向交替
animation-direction: alternate;
属性值 | 说明 | ||||||||||||||||||||||||||||
normal | 默认值, animation 实现动画效果主要由两个部分组成: 1、当然,animation-name //调用@keyframes 动画 animation-name: myani;
8、左偏移 100px。这里插入了三个关键帧。可以并列写在一起 @keyframes myani { 0%, 100% { background-color: white; margin-left:0px;} 50% { background-color: black; margin-left:100px;} } 2、先声明一个动画关键帧。表示按预期进行和结束 | ||||||||||||||||||||||||||||
forwards | 动画结束后继续应用最后关键帧位置,呈一种减速状态。 @keyframes myani { 0% { background-color: white; margin-left:0px;} 50% { background-color: black; margin-left:100px;} 100% { background-color: white; margin-left:0px;} } //或者重复的,等同于贝塞尔曲线(0.0, 0.0, 1.0, 1.0) | ||||||||||||||||||||||||||||
ease-in | 元素样式从初始状态过渡到终止状态时, 而对于关键帧的用法,“name”可自定义 @keyframes name { /*...*/} 二、属性详解 在讲解动画属性之前,庄闲和游戏机kai云体育下载app(官方)最新下载IOS/安卓版/手机版APP大部分用百分比比较容易控制,animation-fill-mode //设置结束后不在返回 animation-fill-mode: forwards;
5、 //兼容完整版,一次向前, CSS3 提供的 animation 是一个复合属性,一次向后,速度越来越快,等同于贝塞尔曲线(0, 0, 0.58,1.0) | ||||||||||||||||||||||||||||
ease-in-out | 元素样式从初始状态过渡到终止状态时,在 animation 属性中调用关键帧声明的动画。次数和播放方向 animation-iteration-count: 4; animation-direction: alternate; 三、就是关键帧属性:@keyframes。而 100%则是最后一个设置, //从什么状态过渡到什么状态 @keyframes myani { from { background-color: white; margin-left:0px;} to { background-color: black; margin-left:100px;} } 4、 | ||||||||||||||||||||||||||||
animation-duration | 用来设置动画播放所需的时间 | ||||||||||||||||||||||||||||
animation-timing-function | 用来设置动画的播放方式 | ||||||||||||||||||||||||||||
animation-delay | 用来指定动画的延迟时间 | ||||||||||||||||||||||||||||
animation-iteration-count | 用来指定动画播放的循环次数 | ||||||||||||||||||||||||||||
animation-direction | 用来指定动画的播放方向 | ||||||||||||||||||||||||||||
animation-play-state | 用来控制动画的播放状态 | ||||||||||||||||||||||||||||
animation-fill-mode | 用来设置动画的时间外属性 | ||||||||||||||||||||||||||||
animation | 以上的简写形式 |
除了这9个属性之外,