Enable drag and drop functionality on a list of elements.
I only provide limited support through the Github Issues area. DO NOT ask for support via email, socialmedia, or other means. Also check the closed issues before opening a new issue.
This plugin is not meant to be a full featured drag & drop plugin. I envision this as a plugin that contains a base set of features that can be enhanced using callbacks by the developer. Because of this I am hesitant on adding functionality but am open to adding callbacks where it makes sense. But feel free to open an issue and suggest a feature request if you feel that most people will benefit from it.
http://springstubbe.us/projects/jquery-dragndrop/
$('ul').dragndrop();
$('ul').dragndrop('unload');
$('ul').dragndrop('reload');
$('ul').dragndrop({
onDrop: function( element, droppedElement ){}
});
Option | Values | Default | Description |
---|---|---|---|
loadStyles | bool | true | load the default styles |
dragElemSelector | string | > * | what elements are draggable |
onDrop | function | fires when an element is dropped |
unload Disable the jQuery Drag & Drop functionality.
reload Reload the jQuery Drag & Drop functionality. Useful if you dynamically add/remove items to be dragged and dropped.
reset Reset elements back to their original position when page loaded. NOT YET IMPLEMENTED
onDrop
Fires after element is dropped into its new position.
onDrop( element, droppedElement )
element: The original element targeted for .dragndrop().
droppedElement: The element that was moved.