mozilla

Revision 22010 of transition-timing-function

  • Revision slug: CSS/transition-timing-function
  • Revision title: transition-timing-function
  • Revision id: 22010
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment 8 words added, 6 words removed

Revision Content

{{ CSSMozExtensionRef() }}{{ gecko_minversion_header("2") }}

Summary

The transition-timing-function CSS property is used to describe how the intermediate values of the CSS properties being affected by a transition effect are calculated. This in essence lets you establish an acceleration curve, so that the speed of the transition can vary over its duration.

This easing function is specified using a cubic Bezier curve defined by four control points; the first and last of these are predefined to be (0, 0) and (1, 1). This property lets you define the values of the other two points, either using keywords to set them to predefined values, or to custom values.

Note: This implementation of the CSS transition-timing-function is based on a draft specification and is therefore experimental : the syntax is subject to change.
  • {{ Xref_cssinitial() }}: ease
  • Applies to: all elements, {{ cssxref(":before") }} and {{ cssxref(":after") }} pseudo elements
  • {{ Xref_cssinherited() }}:no
  • Media: {{ Xref_cssinteractive() }}
  • {{ Xref_csscomputed() }}: as specified

Syntax

-moz-transition-timing-function: <timing-function> [, <timing-function>]*

Values

ease
This keyword sets the easing function to cubic-bezier(0.25, 0.1, 0.25, 1.0).
linear
This keyword sets the easing function to cubic-bezier(0.0, 0.0, 1.0, 1.0).
ease-in
This keyword sets the easing function to cubic-bezier(0.42, 0.0, 1.0, 1.0).
ease-out
This keyword sets the easing function to cubic-bezier(0.0, 0.0, 0.58, 1.0).
ease-in-out
This keyword sets the easing function to cubic-bezier(0.42, 0.0, 0.58, 1.0).
cubic-bezier
Specifies a cubic bezier curve to use as the easing function. The four number values specify the P1 and P2 points of the curve as (x1, y1, x2, y2). All values must be in the range [0.0, 1.0] inclusive.

Examples

There are several examples of CSS transitions included in the main CSS transitions article.

Specifications

Browser compatibility

Browser Lowest Version
Internet Explorer ---
Firefox (Gecko) 4.0 (2.0)
Opera ---
Safari (WebKit) nightly, don't know version

See also

  • CSS transitions
  • {{ cssxref("-moz-transition") }}
  • {{ cssxref("-moz-transition-property") }}
  • {{ cssxref("-moz-transition-duration") }}
  • {{ cssxref("-moz-transition-delay") }}

{{ languages( { "ja": "ja/CSS/transition-timing-function"} ) }}

Revision Source

<p>{{ CSSMozExtensionRef() }}{{ gecko_minversion_header("2") }}</p>
<h3>Summary</h3>
<p>The<code> transition-timing-function </code>CSS property is used to describe how the intermediate values of the CSS properties being affected by a <a href="/en/CSS/CSS_transitions" title="en/CSS/CSS transitions">transition effect</a> are calculated. This in essence lets you establish an acceleration curve, so that the speed of the transition can vary over its duration.</p>
<p>This <strong>easing function</strong> is specified using a cubic Bezier curve defined by four control points; the first and last of these are predefined to be (0, 0) and (1, 1). This property lets you define the values of the other two points, either using keywords to set them to predefined values, or to custom values.</p>
<div class="note"><strong>Note:</strong> This implementation of the CSS <code>transition-timing-function</code> is based on a draft specification and is therefore <em>experimental</em> : the syntax is subject to change.</div>
<ul> <li>{{ Xref_cssinitial() }}: <a href="/en/CSS/timing-function#ease" title="https://developer.mozilla.org/en/CSS/timing-function#ease"><code>ease</code></a></li> <li>Applies to: all elements, {{ cssxref(":before") }} and {{ cssxref(":after") }} pseudo elements</li> <li>{{ Xref_cssinherited() }}:no</li> <li>Media: {{ Xref_cssinteractive() }}</li> <li>{{ Xref_csscomputed() }}: as specified</li>
</ul><h3>Syntax</h3>
<pre>-moz-transition-timing-function: <a href="mks://localhost/en/CSS/timing-function" title="en/CSS/timing-function">&lt;timing-function&gt;</a> [, <a href="mks://localhost/en/CSS/timing-function" title="en/CSS/timing-function">&lt;timing-function&gt;</a>]*
</pre>
<h3>Values</h3>
<dl> <dt>ease</dt> <dd>This keyword sets the easing function to <code>cubic-bezier(0.25, 0.1, 0.25, 1.0)</code>.</dd> <dt>linear</dt> <dd>This keyword sets the easing function to <code>cubic-bezier(0.0, 0.0, 1.0, 1.0)</code>.</dd> <dt>ease-in</dt> <dd>This keyword sets the easing function to <code>cubic-bezier(0.42, 0.0, 1.0, 1.0)</code>.</dd> <dt>ease-out</dt> <dd>This keyword sets the easing function to <code>cubic-bezier(0.0, 0.0, 0.58, 1.0)</code>.</dd> <dt>ease-in-out</dt> <dd>This keyword sets the easing function to <code>cubic-bezier(0.42, 0.0, 0.58, 1.0)</code>.</dd> <dt>cubic-bezier</dt> <dd>Specifies a cubic <a class=" external" href="http://en.wikipedia.org/wiki/B%C3%A9zier_curve" title="http://en.wikipedia.org/wiki/B%C3%A9zier_curve">bezier curve</a> to use as the easing function. The four number values specify the P<sub>1</sub> and P<sub>2</sub> points of the curve as (x<sub>1</sub>, y<sub>1</sub>, x<sub>2</sub>, y<sub>2</sub>). All values must be in the range [0.0, 1.0] inclusive.</dd>
</dl><h3>Examples</h3>
<p>There are several examples of CSS transitions included in the main <a href="/en/CSS/CSS_transitions" title="en/CSS/CSS transitions">CSS transitions</a> article.</p>
<h3>Specifications</h3>
<ul> <li><a class=" external" href="http://www.w3.org/TR/css3-transitions" title="http://www.w3.org/TR/css3-transitions">CSS Transitions Module Level 3</a> (Working Draft)</li>
</ul>
<h3>Browser compatibility</h3>
<table class="standard-table"> <tbody> <tr> <th>Browser</th> <th>Lowest Version</th> </tr> <tr> <td>Internet Explorer</td> <td>---</td> </tr> <tr> <td>Firefox (Gecko)</td> <td>4.0 (2.0)</td> </tr> <tr> <td>Opera</td> <td>---</td> </tr> <tr> <td>Safari (WebKit)</td> <td><em>nightly, don't know version</em></td> </tr> </tbody>
</table>
<h3>See also</h3>
<ul> <li><a href="/en/CSS/CSS_transitions" title="en/CSS/CSS transitions">CSS transitions</a></li> <li>{{ cssxref("-moz-transition") }}</li> <li>{{ cssxref("-moz-transition-property") }}</li> <li>{{ cssxref("-moz-transition-duration") }}</li> <li>{{ cssxref("-moz-transition-delay") }}</li>
</ul>
<p>{{ languages( { "ja": "ja/CSS/transition-timing-function"} ) }}</p>
Revert to this revision