aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/api/htmlelement/transitionend_event/index.html
blob: 73b324086650f97a183dd270191496746f30040d (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
---
title: transitionend
slug: Web/API/HTMLElement/transitionend_event
tags:
  - CSS
translation_of: Web/API/HTMLElement/transitionend_event
original_slug: Web/Events/transitionend
---
<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>

{{Specifications}}

<h2 id="Совместимость_с_браузерами">Совместимость с браузерами</h2>

<p>{{Compat}}</p>

<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>