animatelink
Defines an animation step that combines styling information with timing information.
定义一个动画步骤,它把一些样式信息和时序信息组合在一起。
参数
timings | Sets 为父动画设置
For example, the string "1s 100ms ease-out" specifies a duration of 1000 milliseconds, and delay of 100 ms, and the "ease-out" easing style, which decelerates near the end of the duration. 比如,字符串 "1s 100ms ease-out" 指定了一个 1000 毫秒的持续时间,一个 100 毫秒的延迟和一个 "ease-out" 缓动效果,它会快结束时减速。 |
styles | Sets AnimationStyles for the parent animation. A function call to either 为父动画设置动画样式。 调用 可选. 默认值是 |
返回值
AnimationAnimateMetadata
: An object that encapsulates the animation step.
一个用于封装动画步骤的对象。
使用说明
Call within an animation sequence()
, group()
, or transition()
call to specify an animation step that applies given style data to the parent animation for a given amount of time.
在一个 sequence()
(动画序列)、group()
(动画分组)或 transition()
(转场动画)中调用本函数, 以定义一个动画步骤,来把指定的样式数据在父动画上播放指定的时长。
Syntax Examples
语法范例
Timing examples
时序范例
The following examples show various timings
specifications.
下面的例子展示了各种 timings
(时序)规范。
animate(500)
: Duration is 500 milliseconds.animate(500)
:持续 500 毫秒。animate("1s")
: Duration is 1000 milliseconds.animate("1s")
:持续 1000 毫秒。animate("100ms 0.5s")
: Duration is 100 milliseconds, delay is 500 milliseconds.animate("100ms 0.5s")
:持续 100 毫秒,延迟 500 毫秒。animate("5s ease-in")
: Duration is 5000 milliseconds, easing in.animate("5s ease-in")
:持续 5000 毫秒,缓动进入(ease-in)。animate("5s 10ms cubic-bezier(.17,.67,.88,.1)")
: Duration is 5000 milliseconds, delay is 10 milliseconds, easing according to a bezier curve.animate("5s 10ms cubic-bezier(.17,.67,.88,.1)")
:持续 5000 毫秒,延迟 10 毫秒,基于一条 Bezier 曲线进行缓动。
Style examples
样式范例
The following example calls style()
to set a single CSS style.
下面的例子调用 style()
来设置单个的 CSS 样式。
The following example calls keyframes()
to set a CSS style to different values for successive keyframes.
下面的例子调用 keyframes()
来为各个相邻的关键帧分别设置 CSS 样式。