Does anyone know if jQuery UI\'s Sortable has built-in functionality to keep the original dropped item in it\'s original list?
For example, you have two lists (one \'sou
You can see my solution in action on jsfiddle. I simply amended this jQuery draggable/droppable interaction to suit your needs.
HTML
List 1
- Drag me down
- Drag me down
List 2
- Item 1
- Item 2
- Item 3
- Item 4
- Item 5
jQuery
$(function() {
$("#sortable").sortable({
revert: true
});
$(".draggable").draggable({
connectToSortable: "#sortable",
helper: "clone",
revert: "invalid"
});
$("ul, li").disableSelection();
});
CSS
.demo ul { list-style-type: none; margin: 0; padding: 0; margin-bottom: 20px; }
.demo li { margin: 5px; padding: 5px; width: 150px; border: 1px solid black; }