from V4

从指定值动画到当前目标值。
必须在局部补间参数 Object 中定义。

必填

仅当未定义 to 属性时

接受

默认值

如果只定义了 to 属性,则使用当前目标值

from 代码示例

import { animate } from 'animejs';

animate('.square', {
  opacity: { from: .5 }, // Animate from .5 opacity to 1 opacity
  translateX: { from: '16rem' }, // From 16rem to 0rem
  rotate: {
    from: '-.75turn', // From -.75turn to 0turn
    ease: 'inOutQuad',
  },
});
<div class="large row">
  <div class="square"></div>
</div>