Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/474.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 暂停拉斐尔动画_Javascript_Raphael - Fatal编程技术网

Javascript 暂停拉斐尔动画

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

我用拉斐尔的剧本创作了一部动画。 动画工作得很好,但我想有一个功能,暂停它,并开始在同一个地方,它的暂停 我在raphaels的主页上找到了这个脚本,但不知道如何实现它

    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(); } 
            );
        }