--- title: transitionend slug: Web/API/HTMLElement/transitionend_event tags: - DOM - Event - Referencia - Transiciones CSS - Transiciones CSS3 - TransitionEvent - transitionend translation_of: Web/API/HTMLElement/transitionend_event original_slug: Web/Events/transitionend ---
El evento transitionend
es lanzado cuando una transición CSS se ha completado. Si la transición es eliminada antes de haberse completado, como cuando {{cssxref("transition-property")}} es eliminado o {{cssxref("display")}} se establece a "none"
, entonces el evento no será generado.
Property | Type | Description |
---|---|---|
target {{readonlyInline}} |
{{domxref("EventTarget")}} | The event target (the topmost target in the DOM tree). |
type {{readonlyInline}} |
{{domxref("DOMString")}} | The type of event. |
bubbles {{readonlyInline}} |
{{jsxref("Boolean")}} | Whether the event normally bubbles or not. |
cancelable {{readonlyInline}} |
{{jsxref("Boolean")}} | Whether the event is cancellable or not. |
propertyName {{readonlyInline}} |
{{domxref("DOMString")}} | The name of the CSS property associated with the transition. |
elapsedTime {{readonlyInline}} |
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 {{readonlyInline}} |
{{domxref("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). |
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.
let element = document.getElementById("slidingMenu"); element.addEventListener("transitionend", function(event) { element.innerHTML = "Done!"; }, false);
Especificación | Estado | Comentario |
---|---|---|
{{SpecName("CSS3 Transitions", "#transitionend", "transitionend")}} | {{Spec2('CSS3 Transitions')}} | Definición inicial. |
{{CompatibilityTable}}
Característica | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Soporte básico | 1.0[1] 36 |
{{CompatVersionUnknown}} | {{CompatGeckoDesktop("2.0")}} | 10 | 10.5[2] 12 12.10 23 |
3.2[1] 7.0.6 |
Característica | Android | Edge | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Soporte básico | 2.1 | {{CompatVersionUnknown}} | {{CompatGeckoMobile("2.0")}} | {{CompatUnknown}} | 10[2] 12 12.10 |
3.2[1] |
[1] Implementado en Chrome 1.0, Android 2.1 y WebKit 3.2 como webkitTransitionEnd
. Chrome 36 y WebKit 7.0.6 usan el estándar transitionend
.
[2] Implementado como oTransitionEnd
desde Opera 10.5, como otransitionend
desde la versión 12 y como el estándar transitionend
desde la versión 12.10.
La interfaz {{domxref("TransitionEvent")}}