JSFiddle - React, Tailwind, and code Playground

by digitaloutback

HTML

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"></script>
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/redmond/jquery-ui.css" rel="stylesheet" />

<div id="canvas">
    <div class='lyr'></div>
    <div class='lyr lyr2'></div>
    <div class='resizer'></div>
</div>

CSS

#canvas { width: 500px; height: 300px; position: relative; background: #eee}

.lyr {
    background: yellow;
    position: absolute;
    left: 150px; top: 50px;
    width: 100px; height: 100px;
}
.lyr2 {
    background: blue;
    left: 170px; top: 70px;
    width: 130px; height: 100px;
    z-index: 100;
}
.resizer { border: 1px dashed #333; left: 150px; top: 50px; width: 150px; height: 120px; position: absolute;
}

JavaScript

// Resizable
$('.resizer').resizable({
    aspectRatio: true,
    handles: 'all',
    alsoResize: '.lyr'

});