Reputation: 13
I've created an animation using script.aculo.us. However, when the animation is finished, I want to have it reset all the objects and perform the animation again. I plan to just reset the positions of the objects manually, but how can I make the animations loop? If I put the effect declarations inside a for or while loop, it just crashes the browser.
Any ideas?
Upvotes: 1
Views: 255
Reputation: 59263
One of the options with Scriptaculous effects is to have an afterFinish callback. Simply call your animation again, and you should be good to go. Here's a bit of info on the callbacks:
http://wiki.github.com/madrobby/scriptaculous/core-effects
http://www.tutorialspoint.com/script.aculo.us/scriptaculous_common_parameters.htm
Upvotes: 1