JSFiddle - React, Tailwind, and code Playground
by Carlos DiĂłgenes
HTML
<script src="https://code.jquery.com/ui/1.11.2/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.2/themes/black-tie/jquery-ui.css">
<body>
<div id="parent">
<div id="draggable">
Hello!
</div>
</div>
</body>
CSS
#parent {
background-color: blue;
width: 400px;
height: 400px;
transform: scale(0.8);
-moz-transform: scale(0.8);
-webkit-transform: scale(0.8);
transform-origin: center top 0px;
-moz-transform-origin: center top 0px;
-webkit-transform-origin: center top 0px;
}
#draggable {
background-color: rgba(0,0,0,0.5);
border: 1px solid black;
width: 50px;
height: 50px;
color: white;
}
JavaScript
$("#draggable").resizable({containment: '#parent'}).draggable({
containment: '#parent'
});