Style animationTimingFunction property
Example
changing
The element's animationTimingFunction property:
document.getElementById("myDIV").style.animationTimingFunction="linear";
Try it »
Definition and Usage
The animationTimingFunction property specifies the speed curve of an animation.
The speed curve defines the time an animation takes to change from one set of CSS styles to another.
The speed curve is used to make animations change smoothly.
Browser support





Only Firefox supports the animationTimingFunction property.
Syntax
Return the animationTimingFunction property:
object
.style.animationTimingFunction
Set the animationTimingFunction property:
object
.style.animationTimingFunction="linear|ease|ease-in|ease-out|cubic-bezier(
n
,
n
,
n
,
n
)|initial|inherit"
Attribute values
| Value | Description |
|---|---|
| linear | The animation keeps the same speed from start to end. |
| ease | Default value. The animation has a slow start, then accelerates, and slows down before the end. |
| ease-in | The animation has a slow start. |
| ease-out | The animation has a slow end. |
| ease-in-out | The animation has a slow start and a slow end. |
| cubic-bezier(n,n,n,n) | Define your own value in a cubic-bezier function. |
| Can be a numeric value from 0 to 1. | |
| initial | Sets this property to its default value. See initial. |
| inherit | Inherits this property from its parent element. See inherit. |
Technical Details
| Default value: | ease |
|---|---|
| Return Value: | A string representing the element's animation-timing-function property. |
| CSS version | CSS3 |
Related Articles
CSS Reference Manual:The animation-timing-function property
The Style object