JSFiddle - React, Tailwind, and code Playground
HTML
<div id="target"></div>
<p>
<div class="draggable">Test</div>
</p>
CSS
#target {
width: 80px;
height: 50px;
border:1px solid black;
margin-bottom: 200px;
}
.draggable {
width: 300px;
height: 200px;
border: 1px solid red;
}
JavaScript
$( ".draggable" ).draggable({
helper: 'clone',
start : function(event, ui){
ui.helper.animate({
width: 80,
height: 50
});
},
drag : function(event, ui){
ui.helper.offset({
left: event.pageX,
top: event.pageY
});
}
});
$("#target").droppable({
drop : function(event, ui) {
console.log('dropped');
}
});