velocityMultiplier
Specifies a multiplier to modify the velocity applied to the dragged element after release, where 0 means no velocity at all, 1 is normal velocity and 2 double the velocity.
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
1
velocityMultiplier code example
import { createDraggable } from 'animejs';
createDraggable('.square', {
container: '.grid',
velocityMultiplier: 0,
});
createDraggable('.circle', {
container: '.grid',
velocityMultiplier: 5,
});
<div class="large centered grid square-grid">
<div class="square draggable"></div>
<div class="circle draggable"></div>
</div>