aboutsummaryrefslogtreecommitdiff
path: root/files/es/web/api/htmlelement/transitionend_event/index.html
blob: c1bcbec297b7e9d600494c2339192973f3ddd068 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
---
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
---
<p>El evento <code>transitionend</code> es lanzado cuando una <a href="/en-US/docs/CSS/Using_CSS_transitions">transición CSS</a> 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 <code>"none"</code>, entonces el evento no será generado.</p>

<h2 id="Información_general">Información general</h2>

<dl>
 <dt style="float: left; text-align: right; width: 120px;">Especificación</dt>
 <dd style="margin: 0 0 0 120px;">{{SpecName("CSS3 Transitions")}}</dd>
 <dt style="float: left; text-align: right; width: 120px;">Interfaz</dt>
 <dd style="margin: 0 0 0 120px;">{{domxref("TransitionEvent")}}</dd>
 <dt style="float: left; text-align: right; width: 120px;">Burbuja</dt>
 <dd style="margin: 0 0 0 120px;"></dd>
 <dt style="float: left; text-align: right; width: 120px;">Cancelable</dt>
 <dd style="margin: 0 0 0 120px;"></dd>
 <dt style="float: left; text-align: right; width: 120px;">Objetivo</dt>
 <dd style="margin: 0 0 0 120px;">{{domxref("Element")}}, {{domxref("Document")}}, {{domxref("Window")}}</dd>
 <dt style="float: left; text-align: right; width: 120px;">Acción</dt>
 <dd style="margin: 0 0 0 120px;">undefined</dd>
</dl>

<h2 id="Propiedades">Propiedades</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Property</th>
   <th scope="col">Type</th>
   <th scope="col">Description</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td><code>target</code> {{readonlyInline}}</td>
   <td>{{domxref("EventTarget")}}</td>
   <td>The event target (the topmost target in the DOM tree).</td>
  </tr>
  <tr>
   <td><code>type</code> {{readonlyInline}}</td>
   <td>{{domxref("DOMString")}}</td>
   <td>The type of event.</td>
  </tr>
  <tr>
   <td><code>bubbles</code> {{readonlyInline}}</td>
   <td>{{jsxref("Boolean")}}</td>
   <td>Whether the event normally bubbles or not.</td>
  </tr>
  <tr>
   <td><code>cancelable</code> {{readonlyInline}}</td>
   <td>{{jsxref("Boolean")}}</td>
   <td>Whether the event is cancellable or not.</td>
  </tr>
  <tr>
   <td><code>propertyName</code> {{readonlyInline}}</td>
   <td>{{domxref("DOMString")}}</td>
   <td>The name of the CSS property associated with the transition.</td>
  </tr>
  <tr>
   <td><code>elapsedTime</code> {{readonlyInline}}</td>
   <td>Float</td>
   <td>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 <code>transition-delay</code>.</td>
  </tr>
  <tr>
   <td><code>pseudoElement</code> {{readonlyInline}}</td>
   <td>{{domxref("DOMString")}}</td>
   <td>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).</td>
  </tr>
 </tbody>
</table>

<h2 id="Ejemplo">Ejemplo</h2>

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

<pre class="brush: js">let element = document.getElementById("slidingMenu");
element.addEventListener("transitionend", function(event) {
  element.innerHTML = "Done!";
}, false);
</pre>

<h2 id="Especificaciones">Especificaciones</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Especificación</th>
   <th scope="col">Estado</th>
   <th scope="col">Comentario</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName("CSS3 Transitions", "#transitionend", "transitionend")}}</td>
   <td>{{Spec2('CSS3 Transitions')}}</td>
   <td>Definición inicial.</td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilidad_con_navegadores">Compatibilidad con navegadores</h2>

{{Compat("api.HTMLElement.transitionend_event")}}

<h2 id="Véase_también">Véase también</h2>

<p>La interfaz {{domxref("TransitionEvent")}}</p>

<ul>
 <li>{{event("transitionstart")}}, {{event("transitioncancel")}}</li>
 <li>Propiedades CSS: {{cssxref("transition")}}, {{cssxref("transition-delay")}}, {{cssxref("transition-duration")}}, {{cssxref("transition-property")}}, {{cssxref("transition-timing-function")}}.</li>
</ul>