JSFiddle - React, Tailwind, and code Playground
by sii_side
HTML
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<div id="screen">hoge</div>
CSS
#screen {
width: 300px;
height: 300px;
border: 1px solid #000;
}
.bg {
width: 100px;
height: 100px;
border: 1px solid #000;
}
JavaScript
$('<div class="bg">')
.resizable({
containment: 'parent',
stop: function(event, ui) {
alert('event.target => ' + event.target);
alert($(event.currentTarget).find('img').attr('id'));
}
}).draggable({
containment: 'parent',
scroll: false
}).dblclick(function(event) {
alert('event.target => ' + event.target);
alert($(event.currentTarget).find('img').attr('id'));
}
).append("<img id='test' alt='testtest'>").appendTo('#screen');