to
将 从当前目标值动画到指定值。
必须在本地补间参数Object中定义。
必填
仅当未从 属性定义 时
接受
- Any valid Tween value types
- An
Arrayof two Tween value keyframes ([fromValue, toValue])
默认
如果仅定义了 a from 属性,则使用当前目标值
到代码示例
import { animate } from 'animejs';
animate('.square', {
x: {
to: '16rem', // From 0px to 16rem
ease: 'outCubic',
},
rotate: {
to: '.75turn', // From 0turn to .75turn
ease: 'inOutQuad'
},
});
<div class="large row">
<div class="square"></div>
</div>