EffectTiming.iterationStart - Web APIs 编辑

Experimental

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Web Animations API's EffectTiming dictionary's  iterationStart property specifies the repetition number which repetition the animation begins at and its progress through it.

Element.animate(), KeyframeEffectReadOnly.KeyframeEffectReadOnly(), and KeyframeEffect.KeyframeEffect() all accept an object of timing properties including iterationStart. The value of iterationStart corresponds directly to AnimationEffectTimingReadOnly.iterationStart in timing objects returned by AnimationEffectReadOnly, KeyframeEffectReadOnly, and KeyframeEffect.

Syntax

var timingProperties = {
  iterationStart = iterationNumber
};

timingProperties.iterationStart = iterationNumber;

Value

A floating-point value whose value is at least 0 and is not +Infinity, indicating the offset into the number of iterations the animation sequence is to run at which to start animating. iterationStart represents the iteration index at which the animation effect begins as well as its progress through that iteration.

Usually you'll use a value between 0.0 and 1.0 to indicate an offset into the first run of the animation at which to begin the animation performance, but any positive, non-infinite value is allowed. Since all animations' iteration indexes start at 0, a value of 0.5 would start the animation halfway through its first iteration or loop. Meanwhile, a value of 1.2 means the animation will begin playback 20% of the way through its second iteration, and so forth.

It's currently undefined what happens if you specify a value of iterationStart which is greater than the value of AnimationEffectTimingProperties.iterations. See issue 170 in the Web Animations API specification's issue tracker for details and status of any changes to the specification in this regard.

Specifications

SpecificationStatusComment
Web Animations
The definition of 'iterationStart' in that specification.
Working DraftEditor's draft.

Browser compatibility

BCD tables only load in the browser

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:115 次

字数:6017

最后编辑:6 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文