Window: transitioncancel event

Experimental

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

The transitioncancel event is fired when a CSS transition is canceled.

See GlobalEventHandlers.ontransitioncancel for more information.

Bubbles Yes
Cancelable No
Interface TransitionEvent
Event handler property GlobalEventHandlers.ontransitioncancel

The original target for this event is the Element that had the transition applied. You can listen for this event on the Window interface to handle it in the capture or bubbling phases. For full details on this event please see the page on HTMLElement: transitioncancel.

Examples

This code adds a listener to the transitioncancel event:

window.addEventListener('transitioncancel', () => {
  console.log('Transition canceled');
});

The same, but using the ontransitioncancel property instead of addEventListener():

window.ontransitioncancel = () => {
  console.log('Transition canceled');
};

See a live example of this event.

Specifications

Specification
CSS Transitions Level 2 (CSS Transitions 2)
# transitioncancel

Browser compatibility

BCD tables only load in the browser

See also