这组参数决定动画怎么播放:多久开始、跑多快、怎么缓动、循环几次、结束时停在哪…
在 xjs(target).animate({...}) 里,它们跟“要动的属性”写在同一个对象里。
支持的常用项:duration、delay、endDelay、
easing、direction、loop、
autoplay、fill。
其中 easing 还支持 spring(对象形式)。
.dot { width: 16px; height: 16px; border-radius: 4px; background: var(--highlight-color); }
.dot.orange { background: var(--accent-color); }
.dot.gray { background: #666; }
x 是属性,其余是播放参数)。
duration + easing,就已经很好玩了。
easing 写成对象即可(后面有 spring 专门页面)。