Animation🧪
✅️️ Methods
🔨Animation.disable
禁用动画域通知。
EN
Disables animation domain notifications.
🔨Animation.enable
启用动画域通知。
EN
Enables animation domain notifications.
🔨Animation.getCurrentTime
返回动画的当前时间。
EN
Returns the current time of the an animation.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| id | ✔️ | string | 动画的Id。 | ENId of animation. |
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| currentTime | number | 页面当前时间。 | ENCurrent time of the page. |
🔨Animation.getPlaybackRate
获取文档时间线的播放速率。
EN
Gets the playback rate of the document timeline.
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| playbackRate | number | 页面动画的播放速率。 | ENPlayback rate for animations on page. |
🔨Animation.releaseAnimations
释放一组动画,使其不再受操控。
EN
Releases a set of animations to no longer be manipulated.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| animations | ✔️ | array[string] | 要跳转到的动画ID列表。 | ENList of animation ids to seek. |
🔨Animation.resolveAnimation
获取Animation的远程对象。
EN
Gets the remote object of the Animation.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| animationId | ✔️ | string | 动画ID。 | ENAnimation id. |
| 返回对象 | 类型 | 描述 | 原文 |
|---|---|---|---|
| remoteObject | Runtime.RemoteObject | 对应的远程对象。 | ENCorresponding remote object. |
🔨Animation.seekAnimations
将一组动画定位到每个动画内的特定时间点。
EN
Seek a set of animations to a particular time within each animation.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| animations | ✔️ | array[string] | 要定位的动画ID列表。 | ENList of animation ids to seek. | |
| currentTime | ✔️ | number | 设置每个动画的当前时间。 | ENSet the current time of each animation. |
🔨Animation.setPaused
设置一组动画的暂停状态。
EN
Sets the paused state of a set of animations.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| animations | ✔️ | array[string] | 设置以下动画的暂停状态:''和``内的内容保持不变。 | ENAnimations to set the pause state of. | |
| paused | ✔️ | boolean | 要设置的暂停状态。 | ENPaused state to set to. |
🔨Animation.setPlaybackRate
设置文档时间轴的播放速率。
EN
Sets the playback rate of the document timeline.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| playbackRate | ✔️ | number | 页面动画的播放速率 | ENPlayback rate for animations on page |
🔨Animation.setTiming
设置动画节点的时序。
EN
Sets the timing of an animation node.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| animationId | ✔️ | string | Animation id。 | ENAnimation id. | |
| duration | ✔️ | number | 动画的''duration''。 | ENDuration of the animation. | |
| delay | ✔️ | number | 动画的延迟。 | ENDelay of the animation. |
✅️️ Events
👋Animation.animationCanceled
动画被取消时的事件。
EN
Event for when an animation has been cancelled.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| id | ✔️ | string | 被取消的动画的Id。 | ENId of the animation that was cancelled. |
👋Animation.animationCreated
每个已创建动画的事件。
EN
Event for each animation that has been created.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| id | ✔️ | string | 所创建动画的Id。 | ENId of the animation that was created. |
👋Animation.animationStarted
动画已启动的事件。
EN
Event for animation that has been started.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| animation | ✔️ | Animation | 已启动的动画。 | ENAnimation that was started. |
👋Animation.animationUpdated
动画已更新的事件。
EN
Event for animation that has been updated.
| 参数 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| animation | ✔️ | Animation | 已更新的动画。 | ENAnimation that was updated. |
✅️️ Types
📌Animation.Animation
动画实例。
EN
Animation instance.
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| id | ✔️ | string | Animation 的 id。 | ENAnimation's id. | |
| name | ✔️ | string | Animation的名称。 | ENAnimation's name. | |
| pausedState | ✔️ | boolean | Animation的内部暂停状态。 | ENAnimation's internal paused state. | |
| playState | ✔️ | string | Animation的播放状态。 | ENAnimation's play state. | |
| playbackRate | ✔️ | number | Animation的播放速率。 | ENAnimation's playback rate. | |
| startTime | ✔️ | number | Animation 的开始时间。对于基于时间的动画,单位为毫秒;对于滚动驱动动画(即存在 viewOrScrollTimeline 时),单位为百分比 [0 - 100]。 | ENAnimation's start time. Milliseconds for time based animations and percentage [0 - 100] for scroll driven animations (i.e. when viewOrScrollTimeline exists). | |
| currentTime | ✔️ | number | Animation的当前时间。 | ENAnimation's current time. | |
| type | ✔️ | string | Animation的动画类型。允许的值: CSSTransition、CSSAnimation、WebAnimation | ENAnimation type ofAnimation.Allowed Values: CSSTransition, CSSAnimation, WebAnimation | |
| source | AnimationEffect | Animation的源动画节点。 | ENAnimation's source animation node. | ||
| cssId | string | Animation的唯一ID,代表触发此CSS动画/过渡的源。 | ENA unique ID forAnimation representing the sources that triggered this CSS animation/transition. | ||
| viewOrScrollTimeline | ViewOrScrollTimeline | 查看或滚动时间线 | ENView or scroll timeline |
📌Animation.AnimationEffect
AnimationEffect 实例
EN
AnimationEffect instance
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| delay | ✔️ | number | AnimationEffect的延迟。 | ENAnimationEffect's delay. | |
| endDelay | ✔️ | number | AnimationEffect的结束延迟。 | ENAnimationEffect's end delay. | |
| iterationStart | ✔️ | number | AnimationEffect 的迭代起始点。 | ENAnimationEffect's iteration start. | |
| iterations | number | AnimationEffect 的迭代次数。如果值为无限,则省略。 | ENAnimationEffect's iterations. Omitted if the value is infinite. | ||
| duration | ✔️ | number | AnimationEffect的迭代时长。对于基于时间的动画为毫秒,对于滚动驱动动画(即存在viewOrScrollTimeline时)为百分比[0 - 100]。 | ENAnimationEffect's iteration duration. Milliseconds for time based animations and percentage [0 - 100] for scroll driven animations (i.e. when viewOrScrollTimeline exists). | |
| direction | ✔️ | string | AnimationEffect的播放方向。 | ENAnimationEffect's playback direction. | |
| fill | ✔️ | string | AnimationEffect的填充模式。 | ENAnimationEffect's fill mode. | |
| backendNodeId | DOM.BackendNodeId | AnimationEffect的目标节点。 | ENAnimationEffect's target node. | ||
| keyframesRule | KeyframesRule | AnimationEffect的关键帧。 | ENAnimationEffect's keyframes. | ||
| easing | ✔️ | string | AnimationEffect的计时函数。 | ENAnimationEffect's timing function. |
📌Animation.KeyframesRule
关键帧规则
EN
Keyframes Rule
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| name | string | CSS关键帧动画的名称。 | ENCSS keyframed animation's name. | ||
| keyframes | ✔️ | array[KeyframeStyle] | 动画关键帧列表。 | ENList of animation keyframes. |
📌Animation.KeyframeStyle
关键帧样式
EN
Keyframe Style
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| offset | ✔️ | string | 关键帧的时间偏移量。 | ENKeyframe's time offset. | |
| easing | ✔️ | string | AnimationEffect的计时函数。 | ENAnimationEffect's timing function. |
📌Animation.ViewOrScrollTimeline
时间线实例
EN
Timeline instance
返回类型:object
| 属性 | 必填 | 标记 | 类型 | 描述 | 原文 |
|---|---|---|---|---|---|
| sourceNodeId | DOM.BackendNodeId | 滚动容器节点 | ENScroll container node | ||
| startOffset | number | 表示时间线的起始滚动位置,以像素为单位从滚动原点开始的长度偏移。 | ENRepresents the starting scroll position of the timeline as a length offset in pixels from scroll origin. | ||
| endOffset | number | 表示时间轴结束滚动位置,以像素为单位从滚动原点开始的长度偏移量。 | ENRepresents the ending scroll position of the timeline as a length offset in pixels from scroll origin. | ||
| subjectNodeId | DOM.BackendNodeId | 该元素的主框在滚动视口中的可见性定义了时间线的进度。对于使用ScrollTimeline的动画,此元素不存在。 | ENThe element whose principal box's visibility in the scrollport defined the progress of the timeline. Does not exist for animations with ScrollTimeline | ||
| axis | ✔️ | DOM.ScrollOrientation | 滚动方向 | ENOrientation of the scroll |