---
title: 'HTMLElement: transitioncancel イベント'
slug: Web/API/HTMLElement/transitioncancel_event
tags:
  - CSS Transitions
  - CSS トランジション
  - DOM
  - Event
  - HTMLElement
  - Reference
  - TransitionEvent
  - events
  - transitioncancel
  - イベント
translation_of: Web/API/HTMLElement/transitioncancel_event
---
<div>{{APIRef}}{{SeeCompatTable}}</div>

<p><strong><code>transitioncancel</code></strong> イベントは、 <a href="/ja/docs/Web/CSS/CSS_Transitions/Using_CSS_transitions">CSS トランジション</a>がキャンセルされたときに発生します。</p>

<p>詳しくは {{domxref("GlobalEventHandlers.ontransitioncancel")}} をご覧ください。</p>

<table class="properties">
 <tbody>
  <tr>
   <th scope="row">バブリング</th>
   <td>あり</td>
  </tr>
  <tr>
   <th scope="row">キャンセル</th>
   <td>不可</td>
  </tr>
  <tr>
   <th scope="row">インターフェイス</th>
   <td>{{domxref("TransitionEvent")}}</td>
  </tr>
  <tr>
   <th scope="row">イベントハンドラープロパティ</th>
   <td>{{domxref("GlobalEventHandlers.ontransitioncancel")}}</td>
  </tr>
 </tbody>
</table>

<h2 id="Examples" name="Examples">例</h2>

<p>このコードは、トランジションが定義され、 <code>transitioncancel</code> イベントにリスナーを追加した要素を取得します。</p>

<pre class="brush: js">const transition = document.querySelector('.transition');

transition.addEventListener('transitioncancel', () =&gt; {
  console.log('Transition canceled');
});</pre>

<p>同様に、 {{domxref("GlobalEventHandlers.ontransitioncancel", "ontransitioncancel")}} プロパティを <code>addEventListener()</code> の代わりに使用すると以下のようになります。</p>

<pre class="brush: js">const transition = document.querySelector('.transition');

transition.ontransitioncancel = () =&gt; {
  console.log('Transition canceled');
};
</pre>

<h2 id="Specifications" name="Specifications">仕様書</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">仕様書</th>
   <th scope="col">状態</th>
   <th scope="col">備考</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('CSS3 Transitions', '#transitioncancel', 'transitioncancel')}}</td>
   <td>{{Spec2('CSS3 Transitions')}}</td>
   <td>初回定義</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>

<div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div>

<p>{{Compat("api.HTMLElement.transitioncancel_event")}}</p>

<h2 id="See_also" name="See_also">関連情報</h2>

<ul>
 <li>{{domxref("GlobalEventHandlers.ontransitioncancel")}} イベントハンドラー</li>
 <li>{{domxref("TransitionEvent")}} インターフェイス</li>
 <li>CSS プロパティ: {{cssxref("transition")}}, {{cssxref("transition-delay")}}, {{cssxref("transition-duration")}}, {{cssxref("transition-property")}}, {{cssxref("transition-timing-function")}}</li>
 <li>関連イベント: {{domxref("HTMLElement/transitionrun_event", "transitionrun")}}, {{domxref("HTMLElement/transitionstart_event", "transitionstart")}}, {{domxref("HTMLElement/transitionend_event", "transitionend")}}</li>
 <li>{{domxref("Document")}} を対象としたこのイベント: {{domxref("Document/transitioncancel_event", "transitioncancel")}}</li>
 <li>{{domxref("Window")}} を対象としたこのイベント: {{domxref("Window/transitioncancel_event", "transitioncancel")}}</li>
</ul>