dragSpeed
Specifies a value that affects the dragging speed of the element. The higher the value, the faster the element moves. 0 prevents the element from being dragged, and values less than 0 invert the drag movement.
Accepts
- A
Number - A
Functionthat returns aNumber
When defined using a Function, the value will be automatically refreshed every time the container or target element is resized.
It can also be refreshed manually using the refresh() method.
Default
1
dragSpeed code example
import { createDraggable } from 'animejs';
createDraggable('.square', {
container: '.grid',
dragSpeed: 2,
});
createDraggable('.circle', {
container: '.grid',
dragSpeed: .5,
});
<div class="large centered grid square-grid">
<div class="square draggable"></div>
<div class="circle draggable"></div>
</div>