MDN wants to learn about developers like you: https://qsurvey.mozilla.com/s3/MDN-survey

Наши волонтёры ещё не перевели данную статью на Русский. Присоединяйтесь к нам и помогите сделать эту работу!
Вы можете также прочитать эту статью на English (US).

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

The Animation.timeline property of the Animation interface returns or sets the timeline associated with this animation. A timeline is a source of time values for synchronization purposes, and is an AnimationTimeline-based object. By default, the animation's timeline and the Document's timeline are the same.

Syntax

var animationsTimeline = Animation.timeline;

Animation.timeline = newTimeline;

Value

timeline object to use as the timing source for the animation, or null to use the default, which is the Document's timeline.

Examples

Here we set the animation's timeline to be the same as the document's timeline (this is the default timeline for all animations, by the way):

animation.timeline = document.timeline;

Specifications

Specification Status Comment
Web Animations
The definition of 'Animation.timeline' in that specification.
Working Draft Editor's draft.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support No ?481 No No No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support No No ?481 No No ?

1. From version 48: this feature is behind the dom.animations-api.core.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.

See also

Метки документа и участники

 Внесли вклад в эту страницу: fscholz, Sheppy, birtles, chrisdavidmills, rachelnabors
 Обновлялась последний раз: fscholz,