This page is Almost Ready

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

elapsedTime

Summary

The amount of time the animation has been running, in seconds, since the event fired, excluding any time the animation was paused.

Property of dom/AnimationEventdom/AnimationEvent

Syntax

Note: This property is read-only.

var result = element.elapsedTime;

Examples

//for a predefined animation event that is running
var myAnimEvent = new AnimationEvent();
// . . .
//retrieve the elapased time
var myAnimTime = myAnimEvent.elapsedTime;

Notes

For an animationstart event, the elapsedTime is zero (0.0) unless there was a negative value for animation-delay, in which case the event will be fired with an elapsedTime of (-1 * delay).

Attributions