1
我有一個問題找到一種方法來循環我的動畫與raphaeljs。在動畫上有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();