--- title: transitionend slug: Web/Events/transitionend tags: - CSS translation_of: Web/API/HTMLElement/transitionend_event ---

Событие transitionend срабатывает, когда CSS transition закончил свое выполнение. В случае, когда анимация удаляется до ее завершения(например, если transition-property [en-US] удаляется), то событие не срабатывает.

Общая информация

Интерфейс
{{domxref("TransitionEvent")}}
Всплывает
Да
Отменяемое
Да
Элемент
{{domxref("document")}}, {{domxref("element")}}
Действие по умолчанию
Нет

Свойства

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

Пример

/*
 * Прослушивать событие transitionend на определенном элементе, т.е. #slidingMenu
 * Затем, вызвать определенную функцию, т.е. showMessage()
 */
function showMessage() {
    alert('Transition закончил свое выполнение');
}

var element = document.getElementById("slidingMenu");
element.addEventListener("transitionend", showMessage, false);

Спецификация

Specification Status Comment
{{SpecName("CSS3 Transitions", "#transition-events", "transitionend")}} {{ Spec2('CSS3 Transitions') }} Initial definition.

Совместимость с браузерами

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 1.0 as webkitTransitionEnd {{ CompatGeckoDesktop("2.0") }} 10 10.5 as oTransitionEnd
12 as otransitionend
12.10 as transitionend
3.2 as webkitTransitionEnd
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 2.1 as webkitTransitionEnd {{ CompatGeckoMobile("2.0") }} {{ CompatUnknown() }} 10 as oTransitionEnd
12 as otransitionend
12.10 as transitionend
3.2 as webkitTransitionEnd

Также