I've found jQuery UI demo, which connects draggable and sortable plugins. (http://jqueryui.com/demos/draggable/sortable.html) I would like to make some kind of tree, create similar draggable emlement (yellow) that could be dragged to the old list and at once it would be a another, new sortable list (in which i can put another draggable elements)
Code i've modified:
$(function() {
$( ".sortable" ).sortable({
revert: true
});
$( ".draggable" ).draggable({
connectToSortable: ".sortable",
helper: "clone",
revert: "invalid"
});
$( "ul, li" ).disableSelection();
});
any element
first element
second element
does not work propely. I can only put 'any element' on #sortable-2, only when #sortable-2 is on draggable unsorted list. When I move #sortable-2 list on correct position ( between first and second element I can't put 'any element' on it )
I would appreciate any answers. Thank you!
以上就是Jquery UI: drag new sortable list的详细内容,更多请关注web前端其它相关文章!