I have two columns with draggable li element . When I drag an element from one column to the other column , I need to clone the dragged element and append it to the new column (I want the element to stay in the previous column as well).
ls.droppable({ // ls refers to the column containing draggable elements
greedy:true,
hoverClass: 'drop-hover',
over: function (e, u) {
},
drop: function (e, u) {
afterDrop(u, $(this));
}
});
the afterDrop function is
window.afterDrop = function (u, ls) {
var c = u.draggable.clone(true, true);
var d = jQuery('.onestrip', ls);
d.append(c);
}
now when I drag the newly appended element in the other column , the old element in the previous column is dragged . How do I attach a seperate draggable to the dragged element (I tried disabling then again attaching draggable , but still the same)
EDIT: I made a similar situation , check out this link http://jsbin.com/aseqid/4/edit .... try dragging and dropping the red box into the green box. then again try dragging the previously dropped red box ... the drag event is not attached to the dropped red box ...I have tried attaching the event to the dropped box , but still it references the original red box