Reputation: 2150
I have a problem finding a way to loop my animation with raphaeljs.
I already saw this post
Why won't my Raphael JS animation loop?
however doing the same thing on my animation didn't work, which means its only executed once. My code is:
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();
Upvotes: 1
Views: 690
Reputation: 2150
Never mind, i already answered my question, when using key:value with animation there is no callback parameter!
Upvotes: 1