Spritely jQuery Plugin - Stop All Spritely Animations
I'm developing a sort of 'booklet' with a set of pages that can be viewed one at a time. On each page, there is a lot of animation going on using the jQuery Spritely plugin, both the pan() and sprite() methods, causing it to be very resource-intensive.
When the button is pressed to proceed to the next page, is there a concise way to stop ALL spritely animations that are going on? Or will I need to do so with each element manually?
I ended up creating a scenes object, with each of its child-objects having a boolean active attribute, a create() method, and a destroy() method (which toggled the active attribute).
When I clicked on a button that was supposed to display a new scene of animations, I first looped through the scenes object for any child-objects with their active variable set to true, and then I would call that object's destroy method before finally calling the create() method for the button that was originally clicked.