Latest web development tutorials

HTML DOM Style animationTimingFunction property

Style Object Reference Style Objects

Examples

Change the <div> element animationTimingFunction attributes:

document.getElementById("myDIV").style.animationTimingFunction="linear";

try it"

Definition and Usage

animationTimingFunction predetermined speed curve animation.

Velocity curve defines the animation changes from a set of CSS styles CSS style to another time.

Speed ​​curve is used to make the animation smooth change.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Only Firefox supports animationTimingFunction property.


grammar

Back animationTimingFunction properties:

object .style.animationTimingFunction

Setting animationTimingFunction properties:

object .style.animationTimingFunction="linear|ease|ease-in|ease-out|cubic-bezier(n,n,n,n)|initial|inherit"

Property Value

描述
linear 动画从开始到结束保持相同的速度。
ease 默认值。动画有一个缓慢的开始,然后加速,在结束之前又变慢。
ease-in 动画有一个缓慢的开始。
ease-out 动画有一个缓慢的结束。
ease-in-out 动画有一个缓慢的开始和一个缓慢的结束。
cubic-bezier(n,n,n,n) 在三次贝塞尔(cubic-bezier)函数中定义自己的值。
可以是从 0 到 1 之间的数字值。
initial 设置该属性为它的默认值。请参阅 initial
inherit 从父元素继承该属性。请参阅 inherit

technical details

Defaults: ease
return value: String representing the animation-timing-function property element.
CSS version CSS3


related articles

CSS Reference Manual: Animation-the Timing-function property


Style Object Reference Style Objects