JSFiddle - React, Tailwind, and code Playground
by lukaszjg
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.11/themes/ui-lightness/jquery-ui.css">
<div id="dragme" style="width: 70px; height: 70px; border: 2px solid black;">
<P> Drag me </P>
</div>
<div id="droppable" style="width: 250px; height: 250px; border: 2px solid red;">
<P> Place to drop </P>
</div>
JavaScript
$("#dragme").draggable({
helper: 'clone',
cursor: 'move',
tolerance: 'fit'
});
var x = null;
$("#droppable").droppable({
drop: function(e, ui) {
x = ui.helper.clone();
x.draggable({
helper: 'original',
containment: '#droppable',
tolerance: 'fit'
});
x.resizable();
x.appendTo('#droppable');
ui.helper.remove();
}
});