maxVelocity
Specifies the maximum velocity to apply to the dragged element after release.
Accepts
- A
Numbergreater than or equal to0 - A
Functionthat returns aNumbergreater than or equal to0
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
50
maxVelocity code example
import { createDraggable } from 'animejs';
createDraggable('.square', {
container: '.grid',
maxVelocity: 0,
});
createDraggable('.circle', {
container: '.grid',
maxVelocity: 100,
});
<div class="large centered grid square-grid">
<div class="square draggable"></div>
<div class="circle draggable"></div>
</div>