I am using jQuery UI
and can create an simple drag 'n drop list.
But now, I want to drop the element into an other list. jQuery always thinks the item has been droppen on the false place and slides it back into the origin list.
Check whether your draggable object is already loaded in the viewport. If it is not, it won't work properly. JUST AFTER the draggable object to be absolutely sure that everything is loaded at the correct time.
Using jQuery UI, we can make the DOM(Document Object Model) elements to drag anywhere within the view port. This can be done by clicking on the draggable object by mouse and dragging it anywhere within the view port. If the value of this option is set to false, it will prevent the DOM elements to be dragged .
We can disable drag and drop on HTML elements by setting the draggable attribute to false . We set draggable to false so we can't drag it. We add event listeners for the dragstart and drop events with addEventListener .
I think the solution is found here: http://ui.jquery.com/demos/sortable/#connect-lists
and its done something like this:
$(function() {
$("#sortable1, #sortable2").sortable({
connectWith: ['.connectedSortable']
});
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With