revert()

Restores the draggable element to its initial state and deactivates it.

Returns

The draggable itself

revert() code example

import { createDraggable, utils } from 'animejs';

const [ $revertButton ] = utils.$('.revert');
const [ $enableButton ] = utils.$('.enable');

const draggable = createDraggable('.square');

const revertDraggable = () => draggable.revert();
const enableDraggable = () => draggable.enable();

$revertButton.addEventListener('click', revertDraggable);
$enableButton.addEventListener('click', enableDraggable);
<div class="large centered row">
  <div class="square draggable"></div>
</div>
<div class="large row">
  <fieldset class="controls">
    <button class="button revert">Revert</button>
    <button class="button enable">Enable</button>
  </fieldset>
</div>