raphaeljs在动画上循环的问题

时间:2011-04-05 13:30:52

标签: javascript animation

我找不到用raphaeljs循环播放动画的方法。

我已经看过这篇文章了

Why won't my Raphael JS animation loop?

然而,在我的动画上做同样的事情并不起作用,这意味着它只执行了一次。我的代码是:

var ciclo = function() {
    var ex = easingx.value,
        ey = easingy.value;
        c.animate({
            "20%": {cy: 150, easing: ey,opacity: 100, callback: fade(0)},
            "40%": {cy: 250, easing: ey, callback: fade(1)},
            "60%": {cy: 250, easing: ey, callback: fade(2)},
            "80%": {cy: 150, easing: ey, callback: fade(3)},
            "90%": {cy: 50, easing: ey, callback: fade(4)},
            "100%": {cy: 50, easing: ey,opacity: 0, callback: fade(5)}
        }, 5000).animate({
            "20%": {cx: 50, easing: ex},
            "40%": {cx: 100, easing: ex},
            "60%": {cx: 200, easing: ex},
            "80%": {cx: 250, easing: ex},
            "90%": {cx: 200, easing: ex},
            "100%": {cx: 100, easing: ex}
            }, 5000,ciclo)
    };
ciclo();

1 个答案:

答案 0 :(得分:1)

没关系,我已经回答了我的问题,当使用key:value with animation时没有回调参数!