Draggable Module provides support to enable draggable functionality in Dom Elements.
<div id='drag'>Draggable</div>
<script>
var ele = document.getElementById('drag');
var drag:Draggable = new Draggable(ele,{
clone:false,
drag: function(e) {
//drag handler code.
},
handle:'.class'
});
</script>
string
| string[]
Defines the child element selector which will prevent dragging of element.
Defines the axis to limit the draggable element drag path.The possible axis path values are
x
- Allows drag movement in horizontal direction only.y
- Allows drag movement in vertical direction only. boolean
If clone
set to true, drag operations are performed in duplicate element of the draggable element.
Defaults to true
Defines the distance between the cursor and the draggable element.
number
Defines the minimum distance draggable element to be moved to trigger the drag operation.
Defaults to 1
HTMLElement
| string
Defines the parent element in which draggable element movement will be restricted.
string
Defines the child element selector which will act as drag handle.
Function
Defines the callback function for customizing the cloned element.
boolean
Defines the dragArea is scrollable or not.
string
Defines the scope value to group sets of draggable and droppable items. A draggable with the same scope value will be accepted by the droppable.
Adds the handler to the given event listener.
Parameter | Type | Description |
---|---|---|
eventName | string |
A String that specifies the name of the event |
handler | Function |
Specifies the call to run when the event occurs. |
Returns void
Bind property changes immediately to components
Returns void
Removes the handler from the given event listener.
Parameter | Type | Description |
---|---|---|
eventName | string |
A String that specifies the name of the event to remove |
handler | Function |
Specifies the function to remove |
Returns void
Function
Specifies the callback function for drag event.
Function
Specifies the callback function for dragStart event.
Function
Specifies the callback function for dragStop event.