I have a 2 boxes where user can drop items. You can test it here. That is how my droppable area is look like:
$(".projLeader ol, .projChecker ol").droppable({
tolerance: 'pointer',
hoverClass: 'highlight',
drop: function(ev, ui)
{
var zz = ui.draggable.text()
var xyz = itm.includes(zz);
var item = ui.draggable;
if (!ui.draggable.closest('.placeholder').length) item = item.clone().draggable();// if item was dragged from the source list - clone it
//this.innerHTML = ''; // clean the placeholder
item.addClass('dropClass').appendTo(this);
// append item to placeholder
//add to array
itm.push(zz);
var n = $(this).closest("div.proc").find(".dropClass").length;
$(this).closest("div.proc").find("h6").text("Items Dropped: " + n + ".");
}
});
The problem is when I drag out element and leave it outside droppable area it still there, how can make it disappear or return to the droppable area it was. I mean if user drags it out and leaves it outside droppable area item should back to the droppable area. And I got one more problem when i am dragging item from box1 to box2 it duplicates and not inside box2. How it can be fixed? Thanks for any help