-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for additive animations #7
Comments
Nice! Chaining fixes are excellent but ... this still doesn't completely solve this use case. I want to move the ball to the right based on an event, without the wiggle ever stopping. Very hard to do! This obviously doesn't work: Of course I can hardcode it, breaking down each increment of the wiggle into four sequential steps and adding up the translate values in advance: This works, but it is really tedious, inflexible and error-prone, even for a very simply animation like this one. For example, what if I don't know whether the wiggle animation is running at the time that the click event happens? There would need to be some math here getting the exact properties at the time of the animate call, and re-expressing the animation as a new sequence of animations. This is always the place where smaller js anim libraries seem to break down. |
Oh, I see. You want to continue wiggling while moving |
Things will become to complex, if I add infinite sequential animations as an element for parallel animations. So for you particular case either use some |
Let's say I have an object wiggling from left to right and back in a continuous infinite loop:
and then later, responding to some event, I want to move the whole object a defined distance to the right, without the left-right wiggle ever stopping:
This doesn't work right now:
http://jsfiddle.net/N2v6H/
Instead, the ball goes careening off the screen. Re-expressing the wiggle in parallel at the time of the second call doesn't fix things, either:
http://jsfiddle.net/N2v6H/1/
(This is also throwing an error because the stop method isn't chainable as it stands, another issue.)
I think it's pretty clear that the existing behavior isn't useful in any real world context. My sense is that the cleanest solution might be to add an argument to the animate function, specifying whether it adds to existing animations or overwrites them.
The text was updated successfully, but these errors were encountered: