animation-timing-function - CSS(层叠样式表) 编辑
概述
CSS animation-timing-function属性定义CSS动画在每一动画周期中执行的节奏。
可能值为一或多个 <timing-function>
。
对于关键帧动画来说,timing function作用于一个关键帧周期而非整个动画周期,即从关键帧开始开始,到关键帧结束结束。
定义于一个关键帧区块的缓动函数(animation timing function)应用到改关键帧;另外,若该关键帧没有定义缓动函数,则使用定义于整个动画的缓动函数。
/* Keyword values */
animation-timing-function: ease;
animation-timing-function: ease-in;
animation-timing-function: ease-out;
animation-timing-function: ease-in-out;
animation-timing-function: linear;
animation-timing-function: step-start;
animation-timing-function: step-end;
/* Function values */
animation-timing-function: cubic-bezier(0.1, 0.7, 1.0, 0.1);
animation-timing-function: steps(4, end);
animation-timing-function: frames(10);
/* Multiple animations */
animation-timing-function: ease, step-start, cubic-bezier(0.1, 0.7, 1.0, 0.1);
/* Global values */
animation-timing-function: inherit;
animation-timing-function: initial;
animation-timing-function: unset;
通常用animation
简写定义整个动画属性更为方便。
初始值 | ease |
---|---|
适用元素 | all elements, ::before and ::after pseudo-elements |
是否是继承属性 | 否 |
计算值 | as specified |
Animation type | discrete |
语法
值
<timingfunction>
- 每个
<timing-function>
代表了应用于动画的timing function,定义于animation-property
.
正式语法
<timing-function>#where
<timing-function> = linear | <cubic-bezier-timing-function> | <step-timing-function>
where
<cubic-bezier-timing-function> = ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number <a href="/wiki/zh-CN/docs/CSS/Value_definition_syntax" title="Brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>, <number <a href="/wiki/zh-CN/docs/CSS/Value_definition_syntax" title="Brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>)
<step-timing-function> = step-start | step-end | steps(<integer>[, <step-position>]?)where
<step-position> = jump-start | jump-end | jump-none | jump-both | start | end
示例
规范
规范 | 状态 | 备注 |
---|---|---|
CSS Animations animation-timing-function | Working Draft |
浏览器兼容性
BCD tables only load in the browser
参见
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论