juliangarnier / anime

JavaScript animation engine
https://animejs.com
MIT License
49.63k stars 3.67k forks source link

Animation jittery on multiple animation calls #765

Closed kylegoines closed 3 years ago

kylegoines commented 3 years ago

I dont really know if it's a capital B bug. But when i try to apply a tween, with multiple triggers. maybe theres a way to cancel the previous tween which would stop the jitter effect.

Running a transformX and transformY on an element every mousemove (even if throttled to like 30times a second) seems to create a "rebounding effect" i believe caused by multiple running tweens

Expected behavior I would expect the previous behavior to be canceled, something like greensocks tweenlite.to() animation. If this is more of a "feature" than a bug, is there documentation regarding canceling the animation rather than pause

kylegoines commented 3 years ago

I believe i solved the issue, calling anime.remove(elem) before calling anime({targets: elem}) again seems to stop the jittering effect, if there is a better way please let me know, i will close this ticket - hopefully this helps someone else :)