transitionend

El evento transitionend es lanzado cuando una transición CSS (en-US) se ha completado. Si la transición es eliminada antes de haberse completado, como cuando transition-property es eliminado o display se establece a "none", entonces el evento no será generado.

Información general

Propiedades

Property Type Description
target Read only EventTarget The event target (the topmost target in the DOM tree).
type Read only DOMString The type of event.
bubbles Read only Boolean Whether the event normally bubbles or not.
cancelable Read only Boolean Whether the event is cancellable or not.
propertyName Read only DOMString The name of the CSS property associated with the transition.
elapsedTime Read only Float The amount of time the transition has been running, in seconds, as of the time the event was generated. This value is not affected by the value of transition-delay.
pseudoElement Read only DOMString The name (beginning with two colons) of the CSS pseudo-element on which the transition occured (in which case the target of the event is that pseudo-element's corresponding element), or the empty string if the transition occurred on an element (which means the target of the event is that element).

Ejemplo

Este ejemplo establece un manejador de evento para detectar el evento transitionend, y así cambiar el texto que se muestra dentro del elemento cuando la transición se completa.

js
let element = document.getElementById("slidingMenu");
element.addEventListener(
  "transitionend",
  function (event) {
    element.innerHTML = "Done!";
  },
  false,
);

Especificaciones

Specification
CSS Transitions
# transitionend

Compatibilidad con navegadores

BCD tables only load in the browser

Véase también