当前位置: 首页 > 文档资料 > Snap.svg 英文文档 >

Set.animate(…)

优质
小牛编辑
130浏览
2023-12-01

Animates each element in set in sync.

Parameters

  1. attrsobjectkey-value pairs of destination attributes
  2. durationnumberduration of the animation in milliseconds
  3. easingfunctioneasing function frommina or custom
  4. callbackfunctioncallback function that executes whenthe animation ends

or

Parameters

  1. animationarrayarray of animation parameter for eachelement in set in format [attrs, duration, easing, callback]

Usage

// animate all elements in set to radius 10
set.animate({r: 10}, 500, mina.easein);
// or
// animate first element to radius 10, but second to radius 20 and in different time
set.animate([{r: 10}, 500, mina.easein], [{r: 20}, 1500, mina.easein]);

Returns: Element the current element