draggable-lst
Make array elements draggable
Usage
HTML
<div id="content"></div>
JavaScript
import Draggable from 'draggable'
new Draggable({
groupElement: document.getElementById('content'),
dragElement: (e) => {
return e.target
},
dragEnd: (olddom, newdom) => {
...
}
})
Options
groupElement | HTMLElement | - | List parent element |
scrollElement | HTMLElement | - | List scroll element. If not passed, the default is the same as the groupElement |
dragElement | Function | (e) => e.target | Element node selected when dragging |
dragEnd | Function | (old, new) => {} | The callback function when the drag is completed |
cloneElementStyle | Object | {} | The style of the mask element when dragging |
cloneElementClass | String | '' | The class of the mask element when dragging |
delay | Number | 300 | animation delay |