stop()
Stop all currently running animations targeting the draggable, the container scroll animation and the draggable release animation.
Returns
The draggable itself
stop() code example
import { createDraggable, animate, utils } from 'animejs';
const [ $stopButton ] = utils.$('.stop');
const draggable = createDraggable('.square');
animate(draggable, {
x: [-100, 100],
alternate: true,
loop: true
});
const stopDraggable = () => draggable.stop();
$stopButton.addEventListener('click', stopDraggable);
<div class="large centered row">
<div class="square draggable"></div>
</div>
<div class="large row">
<fieldset class="controls">
<button class="button stop">Stop</button>
</fieldset>
</div>