跳到主要内容

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.
返回对象类型描述原文
currentTimenumber页面当前时间。
ENCurrent time of the page.

🔨Animation.getPlaybackRate

获取文档时间线的播放速率。

EN
Gets the playback rate of the document timeline.
返回对象类型描述原文
playbackRatenumber页面动画的播放速率。
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.
返回对象类型描述原文
remoteObjectRuntime.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✔️stringAnimation 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✔️stringAnimation 的 id。
ENAnimation's id.
name✔️stringAnimation的名称。
ENAnimation's name.
pausedState✔️booleanAnimation的内部暂停状态。
ENAnimation's internal paused state.
playState✔️stringAnimation的播放状态。
ENAnimation's play state.
playbackRate✔️numberAnimation的播放速率。
ENAnimation's playback rate.
startTime✔️numberAnimation 的开始时间。对于基于时间的动画,单位为毫秒;对于滚动驱动动画(即存在 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✔️numberAnimation的当前时间。
ENAnimation's current time.
type✔️stringAnimation的动画类型。
允许的值:CSSTransitionCSSAnimationWebAnimation
ENAnimation type of Animation.
Allowed Values: CSSTransition, CSSAnimation, WebAnimation
sourceAnimationEffectAnimation的源动画节点。
ENAnimation's source animation node.
cssIdstringAnimation的唯一ID,代表触发此CSS动画/过渡的源。
ENA unique ID for Animation representing the sources that triggered this CSS animation/transition.
viewOrScrollTimelineViewOrScrollTimeline查看或滚动时间线
ENView or scroll timeline

📌Animation.AnimationEffect

AnimationEffect 实例

EN
AnimationEffect instance

返回类型:object

属性必填标记类型描述原文
delay✔️numberAnimationEffect的延迟。
ENAnimationEffect's delay.
endDelay✔️numberAnimationEffect的结束延迟。
ENAnimationEffect's end delay.
iterationStart✔️numberAnimationEffect 的迭代起始点。
ENAnimationEffect's iteration start.
iterationsnumberAnimationEffect 的迭代次数。如果值为无限,则省略。
ENAnimationEffect's iterations. Omitted if the value is infinite.
duration✔️numberAnimationEffect的迭代时长。对于基于时间的动画为毫秒,对于滚动驱动动画(即存在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✔️stringAnimationEffect的播放方向。
ENAnimationEffect's playback direction.
fill✔️stringAnimationEffect的填充模式。
ENAnimationEffect's fill mode.
backendNodeIdDOM.BackendNodeIdAnimationEffect的目标节点。
ENAnimationEffect's target node.
keyframesRuleKeyframesRuleAnimationEffect的关键帧。
ENAnimationEffect's keyframes.
easing✔️stringAnimationEffect的计时函数。
ENAnimationEffect's timing function.

📌Animation.KeyframesRule

关键帧规则

EN
Keyframes Rule

返回类型:object

属性必填标记类型描述原文
namestringCSS关键帧动画的名称。
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✔️stringAnimationEffect的计时函数。
ENAnimationEffect's timing function.

📌Animation.ViewOrScrollTimeline

时间线实例

EN
Timeline instance

返回类型:object

属性必填标记类型描述原文
sourceNodeIdDOM.BackendNodeId滚动容器节点
ENScroll container node
startOffsetnumber表示时间线的起始滚动位置,以像素为单位从滚动原点开始的长度偏移。
ENRepresents the starting scroll position of the timeline as a length offset in pixels from scroll origin.
endOffsetnumber表示时间轴结束滚动位置,以像素为单位从滚动原点开始的长度偏移量。
ENRepresents the ending scroll position of the timeline as a length offset in pixels from scroll origin.
subjectNodeIdDOM.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