mozilla

Revision 459901 of TransitionEvent

  • Revision slug: Web/API/TransitionEvent
  • Revision title: TransitionEvent
  • Revision id: 459901
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{APIRef("Event")}} {{SeeCompatTable}}

The TransitionEvent interface represents events providing information related to transitions.

Properties

Also inherits properties from its parent {{domxref("Event")}}.

{{domxref("TransitionEvent.animationName")}} {{readonlyInline}}
Is a {{domxref("DOMString")}} containing the name CSS property associated with the transition.
{{domxref("TransitionEvent.elapsedTime")}} {{readonlyInline}}
Is a float giving the amount of time the transtion has been running, in seconds, when this event fired. This value is not affected by the {{cssxref("transition-delay")}} property.
{{domxref("TransitionEvent.pseudoElement")}} {{readonlyInline}}
Is a {{domxref("DOMString")}}, starting with '::', containing the name of the pseudo-element the animation runs on. If the transition doesn't run on a pseudo-element but on the element, an empty string: ''.

Constructor

{{domxref("TransitionEvent.TransitionEvent", "TransitionEvent()")}}
Creates a TransitionEvent event with the given parameters.

Methods

Also inherits properties from its parent {{domxref("Event")}}.

{{domxref("TransitionEvent.initTransitionEvent()")}} {{non-standard_inline}}{{deprecated_inline}}
Initializes a TransitionEvent created using the deprecated {{domxref("Document.createEvent()", "Document.createEvent(\"TransitionEvent\")")}} method.

Specifications

Specification Status Comment
{{ SpecName('CSS3 Transitions', '#Events-TransitionEvent', 'TransitionEvent') }} {{ Spec2('CSS3 Transition') }} Initial definition.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatVersionUnknown}} {{ CompatGeckoDesktop("4.0") }} 10.0 {{CompatVersionUnknown}} {{CompatVersionUnknown}}
TransitionEvent() constructor {{CompatNo}} {{ CompatGeckoDesktop("23.0") }} {{CompatNo}} {{CompatNo}} {{CompatNo}}
initTransitionEvent() {{non-standard_inline}}{{deprecated_inline}} {{CompatVersionUnknown}} {{ CompatGeckoDesktop("6.0") }}
Removed in {{ CompatGeckoDesktop("23.0") }}
10.0 {{CompatVersionUnknown}} {{CompatVersionUnknown}}
pseudoelement {{CompatNo}} {{ CompatGeckoDesktop("23.0") }} {{CompatNo}} {{CompatNo}} {{CompatNo}}
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatVersionUnknown}} {{ CompatGeckoMobile("4.0") }} 10.0 {{CompatVersionUnknown}} {{CompatVersionUnknown}}
TransitionEvent() constructor {{CompatNo}} {{ CompatGeckoMobile("23.0") }} {{CompatNo}} {{CompatNo}} {{CompatNo}}
initTransitionEvent() {{non-standard_inline}}{{deprecated_inline}} {{CompatVersionUnknown}} {{ CompatGeckoMobile("4.0") }}
Removed in {{ CompatGeckoMobile("23.0") }}
10.0 {{CompatVersionUnknown}} {{CompatVersionUnknown}}
pseudoelement {{CompatNo}} {{ CompatGeckoMobile("23.0") }} {{CompatNo}} {{CompatNo}} {{CompatNo}}

See also

Revision Source

<p>{{APIRef("Event")}} {{SeeCompatTable}}</p>
<p>The <code><strong>Transition</strong></code><strong><code>Event</code></strong> interface represents events providing information related to <a href="/en-US/docs/Web/Guide/CSS/Using_CSS_transitions" title="/en-US/docs/Web/Guide/CSS/Using_CSS_transitions">transitions</a>.</p>
<h2 id="Properties">Properties</h2>
<p><em>Also inherits properties from its parent {{domxref("Event")}}</em>.</p>
<dl>
  <dt>
    {{domxref("TransitionEvent.animationName")}} {{readonlyInline}}</dt>
  <dd>
    Is a {{domxref("DOMString")}} containing the name CSS property associated with the transition.</dd>
  <dt>
    {{domxref("TransitionEvent.elapsedTime")}} {{readonlyInline}}</dt>
  <dd>
    Is a <code>float</code> giving the amount of time the transtion has been running, in seconds, when this event fired. This value is not affected by the {{cssxref("transition-delay")}} property.</dd>
  <dt>
    {{domxref("TransitionEvent.pseudoElement")}} {{readonlyInline}}</dt>
  <dd>
    Is a {{domxref("DOMString")}}, starting with <code>'::'</code>, containing the name of the <a href="/en-US/docs/Web/CSS/Pseudo-elements" title="/en-US/docs/Web/CSS/Pseudo-elements">pseudo-element</a> the animation runs on. If the transition doesn't run on a pseudo-element but on the element, an empty string: <code>''</code><code>.</code></dd>
</dl>
<h2 id="Constructor">Constructor</h2>
<dl>
  <dt>
    {{domxref("TransitionEvent.TransitionEvent", "TransitionEvent()")}}</dt>
  <dd>
    Creates a <code>TransitionEvent</code> event with the given parameters.</dd>
</dl>
<h2 id="Methods">Methods</h2>
<p><em>Also inherits properties from its parent {{domxref("Event")}}</em>.</p>
<dl>
  <dt>
    {{domxref("TransitionEvent.initTransitionEvent()")}} {{non-standard_inline}}{{deprecated_inline}}</dt>
  <dd>
    Initializes a <code>TransitionEvent</code> created using the deprecated {{domxref("Document.createEvent()", "Document.createEvent(\"TransitionEvent\")")}} method.</dd>
</dl>
<h2 id="Specifications">Specifications</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', '#Events-TransitionEvent', 'TransitionEvent') }}</td>
      <td>{{ Spec2('CSS3 Transition') }}</td>
      <td>Initial definition.</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</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</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{ CompatGeckoDesktop("4.0") }}</td>
        <td>10.0</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
      </tr>
      <tr>
        <td><code>TransitionEvent()</code> constructor</td>
        <td>{{CompatNo}}</td>
        <td>{{ CompatGeckoDesktop("23.0") }}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
      </tr>
      <tr>
        <td><code>initTransitionEvent()</code> {{non-standard_inline}}{{deprecated_inline}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{ CompatGeckoDesktop("6.0") }}<br />
          Removed in {{ CompatGeckoDesktop("23.0") }}</td>
        <td>10.0</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
      </tr>
      <tr>
        <td><code>pseudoelement</code></td>
        <td>{{CompatNo}}</td>
        <td>{{ CompatGeckoDesktop("23.0") }}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</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 Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{ CompatGeckoMobile("4.0") }}</td>
        <td>10.0</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
      </tr>
      <tr>
        <td><code>TransitionEvent()</code> constructor</td>
        <td>{{CompatNo}}</td>
        <td>{{ CompatGeckoMobile("23.0") }}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
      </tr>
      <tr>
        <td><code>initTransitionEvent()</code> {{non-standard_inline}}{{deprecated_inline}}</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{ CompatGeckoMobile("4.0") }}<br />
          Removed in {{ CompatGeckoMobile("23.0") }}</td>
        <td>10.0</td>
        <td>{{CompatVersionUnknown}}</td>
        <td>{{CompatVersionUnknown}}</td>
      </tr>
      <tr>
        <td><code>pseudoelement</code></td>
        <td>{{CompatNo}}</td>
        <td>{{ CompatGeckoMobile("23.0") }}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
        <td>{{CompatNo}}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="See_also">See also</h2>
<ul>
  <li><a href="/en-US/docs/Web/Guide/CSS/Using_CSS_transitions">Using CSS transitions</a></li>
  <li>{{ CSS_Reference:transitions }}</li>
</ul>
Revert to this revision