Interactable.draggable([options])⚓➭
Gets or sets whether drag actions can be performed on the Interactable
Returns: boolean Indicates if this can be the target of drag events
var isDraggable = interact('ul li').draggable();
or
Parameters
- options boolean object true/false or An object with event listeners to be fired on drag events (object makes the Interactable draggable)
Returns: object This Interactable
interact(element).draggable({
onstart: function (event) {},
onmove : function (event) {},
onend : function (event) {},
// the axis in which the first movement must be
// for the drag sequence to start
// 'xy' by default - any direction
startAxis: 'x' || 'y' || 'xy',
// 'xy' by default - don't restrict to one axis (move in any direction)
// 'x' or 'y' to restrict movement to either axis
// 'start' to restrict movement to the axis the drag started in
lockAxis: 'x' || 'y' || 'xy' || 'start',
// max number of drags that can happen concurrently
// with elements of this Interactable. Infinity by default
max: Infinity,
// max number of drags that can target the same element+Interactable
// 1 by default
maxPerElement: 2
});