Javascript 暂停拉斐尔动画
我用拉斐尔的剧本创作了一部动画。 动画工作得很好,但我想有一个功能,暂停它,并开始在同一个地方,它的暂停 我在raphaels的主页上找到了这个脚本,但不知道如何实现它Javascript 暂停拉斐尔动画,javascript,raphael,Javascript,Raphael,我用拉斐尔的剧本创作了一部动画。 动画工作得很好,但我想有一个功能,暂停它,并开始在同一个地方,它的暂停 我在raphaels的主页上找到了这个脚本,但不知道如何实现它 elproto.stop = function (anim) { for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.id == this.id && (!anim || ani
elproto.stop = function (anim) {
for (var i = 0; i < animationElements.length; i++) if (animationElements[i].el.id == this.id && (!anim || animationElements[i].anim == anim)) {
if (eve("anim.stop." + this.id, this, animationElements[i].anim) !== false) {
animationElements.splice(i--, 1);
}
}
return this;
};
谢谢你。我终于明白了。刚刚使用了这个函数stopRect1{rect1.pause;};
function moveRect1()
{
if( xEnd == 150 )
xEnd = 50;
else
xEnd = 150;
rect1.animate( {x: xEnd},
1000,
"Sine",
function (){ moveRect1(); }
);
}