A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/Animation/cancel_event below:

Animation: cancel event - Web APIs

Animation: cancel event

Baseline Widely available

The cancel event of the Animation interface is fired when the Animation.cancel() method is called or when the animation enters the "idle" play state from another state, such as when the animation is removed from an element before it finishes playing.

Note: Creating a new animation that is initially idle does not trigger a cancel event on the new animation.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

addEventListener("cancel", (event) => { })

oncancel = (event) => { }
Event type Event properties

In addition to the properties listed below, properties from the parent interface, Event, are available.

AnimationPlaybackEvent.currentTime Read only

The current time of the animation that generated the event.

AnimationPlaybackEvent.timelineTime Read only

The time value of the timeline of the animation that generated the event.

Examples

If this animation is canceled, remove its element.

animation.oncancel = (event) => {
  animation.effect.target.remove();
};
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4