Web Animations API - Web APIs 编辑

The Web Animations API allows for synchronizing and timing changes to the presentation of a Web page, i.e. animation of DOM elements. It does so by combining two models: the Timing Model and the Animation Model.

Concepts and usage

The Web Animations API provides a common language for browsers and developers to describe animations on DOM elements. To get more information on the concepts behind the API and how to use it, read Using the Web Animations API.

Web Animations interfaces

Animation
Provides playback controls and a timeline for an animation node or source. Can take an object created with the KeyframeEffect() constructor.
KeyframeEffect
Describes sets of animatable properties and values, called keyframes and their timing options. These can then be played using the Animation() constructor.
AnimationTimeline
Represents the timeline of animation. This interface exists to define timeline features (inherited by DocumentTimeline and future timeline objects) and is not itself accessed by developers.
AnimationEvent
Actually part of CSS Animations.
DocumentTimeline
Represents animation timelines, including the default document timeline (accessed using the Document.timeline property).
EffectTiming
Element.animate(), KeyframeEffectReadOnly.KeyframeEffectReadOnly(), and KeyframeEffect.KeyframeEffect() all accept an optional dictionary object of timing properties.

Extensions to other interfaces

The Web Animations API adds some new features to document and element.

Extensions to the Document interface

document.timeline
The DocumentTimeline object representing the default document timeline.
document.getAnimations()
Returns an Array of Animation objects currently in effect on elements in the document.

Extensions to the Element interface

Element.animate()
A shortcut method for creating and playing an animation on an element. It returns the created Animation object instance.
Element.getAnimations()
Returns an Array of Animation objects currently affecting an element or which are scheduled to do so in future.

Specifications

SpecificationStatusComment
Web AnimationsWorking DraftInitial definition

See also

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

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

发布评论

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

词条统计

浏览:60 次

字数:5852

最后编辑:7 年前

编辑次数:0 次

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