创建两个完全重叠的圆
<svg version="1.1" width="500" height="500" xmlns="http://www.w3.org/2000/svg">
<circle cx="100" cy="100" r="30" />
<circle cx="100" cy="100" r="30"style="fill: orange" />
</svg>
设置这两个圆从其初始位置向外远离的动画
// 将其中一个圆向左移
$("#circleLeft").velocity({ cx: "-=15px" }, { easing: "spring" });
// 将另一个圆向右移
$("#circleRight").velocity({ cx: "+=15px" }, { easing: "spring" });
为SVG元素指定监听鼠标的事件
$("svg").on("mouseover mouseout", function() {
5
$("#circleLeft, #circleRight").velocity("reverse");
});
