---
id: 587d78a8367417b2b2512ae7
title: Change Animation Timing with Keywords
challengeType: 0
videoUrl: ''
localeTitle: 使用关键字更改动画计时
---
## Description
在CSS动画中, animation-timing-function
属性控制动画元素在动画持续时间内的变化速度。如果动画是在给定时间( animation-duration
)从A点移动到B点的汽车,则animation-timing-function
表示汽车在行驶过程中如何加速和减速。有许多预定义的关键字可用于热门选项。例如,默认值为ease
,它开始缓慢,在中间加速,然后在最后再次减速。其他选项包括ease-out
,在开始时快速然后减速, ease-in
,在开始时缓慢,然后在结束时加速,或linear
,其在整个过程中应用恒定的动画速度。
## Instructions
用于与ID的元素ball1
和ball2
,一个添加animation-timing-function
属性的每个,并设置#ball1
至linear
,和#ball2
到ease-out
。注意元素在动画期间如何移动但在一起结束之间的区别,因为它们共享相同的animation-duration
2秒。
## Tests
```yml
tests:
- text: 具有id ball1
的元素的animation-timing-function
属性的值应该是线性的。
testString: 'assert($("#ball1").css("animation-timing-function") == "linear", "The value of the animation-timing-function
property for the element with the id ball1
should be linear.");'
- text: 具有id ball2
的元素的animation-timing-function
属性的ball2
应该是缓出的。
testString: 'assert($("#ball2").css("animation-timing-function") == "ease-out", "The value of the animation-timing-function
property for the element with the id ball2
should be ease-out.");'
```
## Challenge Seed
## Solution
```js
// solution required
```