Looping an animation made with script.aculo.us
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 anima开发者_JAVA技巧tions loop? If I put the effect declarations inside a for or while loop, it just crashes the browser.
Any ideas?
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
精彩评论