Need to remove the clone element in html5 drag and drop

803 views Asked by At

I have a div element which I am able to drag however I wish to drop it in a specific div element. Here, I need to remove the dragged cloned element div while drag and also the original dragged element shouldn't be change.

I used a custom helper div while dragging. Here, how can I remove the cloned dragged element?

I'm using the below code,

dragStart: function(event){
    event.preventDefault();
},
drag: function(event){ 
    event.preventDefault();
    var self = this; 
    var posi_left = event.originalEvent.clientX;
    var posi_right = event.originalEvent.clientY;
    $('#helperdiv').css({'left': posi_left, 'top': posi_right });
},

drop: function(event) {
    event.preventDefault();
}

JSBIN LINK: JSBIN DEMO

enter image description here

0

There are 0 answers