This is my first post in these forums, so I'd like to start off by saying thanks. I've been using GreenSock for a month now, and have been impressed with the API and documentation. It's really been a pleasure to work with.
My question is about whether there are any recommendations or best practices around creating, removing, or rearranging elements in the DOM... during animations. For simple animations, I suspect it is easiest to make such changes before or after the animation is done, and to just hide them in some way while animating. Maybe my situation is not very common, but my animations are being driven programmatically and the types and numbers of such changes is variable and seems quite cumbersome to manage. So I am wondering whether others are dealing with this kind of problem, and how.
The technique that I have stumbled onto involves using timeline.call() to set callbacks that toggle these changes to be made or un-made every time they are triggered/called. These callbacks also also keep track of the objects being created or destroyed, to allow them to persist along with any animations applied them. This allows the user to see the correct thing when they restart or scrub backwards through the timeline. I have some utility methods to help create these callbacks with a few variations whenever they are needed (and also to make other undoable changes to the rest of my application's state). Does this sound like what others are doing? Or are there other ways that people are tackling this kind of problem? Or maybe it's just not a very common problem(?).