I have a slider and a rotation animation.
So, something like this:
speed = 2000
var rotate1 = anime({
targets: '#ferris',
rotate: '1turn',
loop:false,
easing: 'linear',
duration: speed,
})
Everytime I update the value in the slider, I update speed and I want to somehow call the animation again, stopping the old one and starting the new one with the updated value of speed.
How can I do this? I tried messing with rotate1.pause, and rotate1.restart, but to no avail.
Thanks