Document: 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 Document 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:
document.addEventListener('transitioncancel', () => {
console.log('Transition canceled');
});
The same, but using the ontransitioncancel property instead of addEventListener():
document.ontransitioncancel = () => {
console.log('Transition canceled');
};
Specifications
| Specification |
|---|
| CSS Transitions Level 2 # transitioncancel |
Browser compatibility
BCD tables only load in the browser
See also
- The
GlobalEventHandlers.ontransitioncancelevent handler - The
TransitionEventinterface - CSS properties:
transition,transition-delay,transition-duration,transition-property,transition-timing-function - Related events:
transitionrun,transitionstart,transitionend - This event on
HTMLElementtargets:transitioncancel - This event on
Windowtargets:transitioncancel