Duplicates after Drop
Duplicates after Drop
Hello.
I have problem with drag'n'drop. When I drop element I create text
(for sample) in drop zone. But instead of one string, I have two
strings. It's very strange and I can't understand why it's happens.
$(".draggable").draggable({helper:'clone', zIndex:1000});
$("#dropzone").droppable({
accept: '.draggable',
activeClass: 'droppable-active',
hoverClass: 'droppable-hover',
tolerance: 'touch',
drop: function(ev, ui) {
var el = $(ui.draggable.element).clone();
$(this).append($(document.createElement('div')).text($
(ui.draggable.element).attr("src")));
}
});
Here my code. Thanks!