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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
---
title: transitionend
slug: Web/Events/transitionend
tags:
- CSS
translation_of: Web/API/HTMLElement/transitionend_event
---
<p><span style="line-height: 1.5;">Событие </span><code style="font-style: normal; line-height: 1.5;">transitionend</code><span style="line-height: 1.5;"> срабатывает, когда</span><span style="line-height: 1.5;"> </span><a href="/en-US/docs/CSS/Using_CSS_transitions" style="line-height: 1.5;">CSS transition</a><span style="line-height: 1.5;"> закончил свое выполнение. В случае, когда анимация удаляется до ее завершения(например, если <a href="/en-US/docs/Web/CSS/transition-property">transition-property [en-US]</a> </span><span style="line-height: 1.5;">удаляется), то событие не срабатывает.</span></p>
<h2 id="Общая_информация">Общая информация</h2>
<dl>
<dt style="float: left; text-align: right; width: 120px;">Интерфейс</dt>
<dd style="margin: 0 0 0 120px;">{{domxref("TransitionEvent")}}</dd>
<dt style="float: left; text-align: right; width: 120px;">Всплывает</dt>
<dd style="margin: 0 0 0 120px;">Да</dd>
<dt style="float: left; text-align: right; width: 120px;">Отменяемое</dt>
<dd style="margin: 0 0 0 120px;">Да</dd>
<dt style="float: left; text-align: right; width: 120px;">Элемент</dt>
<dd style="margin: 0 0 0 120px;">{{domxref("document")}}, {{domxref("element")}}</dd>
<dt style="float: left; text-align: right; width: 120px;">Действие по умолчанию</dt>
<dd style="margin: 0 0 0 120px;">Нет</dd>
</dl>
<h2 id="Свойства">Свойства</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="Пример">Пример</h2>
<pre class="brush: js">/*
* Прослушивать событие <span style="font-size: 1rem;">transitionend на определенном элементе, т.е. </span><span style="font-size: 1rem;">#slidingMenu</span>
* Затем, вызвать определенную функцию, т.е. showMessage()
*/
function showMessage() {
alert('Transition закончил свое выполнение');
}
var element = document.getElementById("slidingMenu");
element.addEventListener("transitionend", showMessage, false);
</pre>
<h2 id="Спецификация">Спецификация</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName("CSS3 Transitions", "#transition-events", "transitionend")}}</td>
<td>{{ Spec2('CSS3 Transitions') }}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="Совместимость_с_браузерами">Совместимость с браузерами</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Chrome</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari (WebKit)</th>
</tr>
<tr>
<td>Basic support</td>
<td>1.0 as <code>webkitTransitionEnd</code></td>
<td>{{ CompatGeckoDesktop("2.0") }}</td>
<td>10</td>
<td>10.5 as <code>oTransitionEnd</code><br>
12 as <code>otransitionend</code><br>
12.10 as <code>transitionend</code></td>
<td>3.2 as <code>webkitTransitionEnd</code></td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Android</th>
<th>Firefox Mobile (Gecko)</th>
<th>IE Phone</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>Basic support</td>
<td>2.1 as <code>webkitTransitionEnd</code></td>
<td>{{ CompatGeckoMobile("2.0") }}</td>
<td>{{ CompatUnknown() }}</td>
<td>10 as <code>oTransitionEnd</code><br>
12 as <code>otransitionend</code><br>
12.10 as <code>transitionend</code></td>
<td>3.2 as <code>webkitTransitionEnd</code></td>
</tr>
</tbody>
</table>
</div>
<h2 id="Также">Также</h2>
<ul>
<li>The {{ domxref("TransitionEvent") }} interface and the <a href="/en-US/docs/Mozilla_event_reference/transitionend" title="The 'transitionend' event"><code>transitionend</code></a> event.</li>
</ul>
|