JSFiddle - React, Tailwind, and code Playground
by Manjula Dhamodharan
HTML
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<div id="draggable" class="ui-widget-content">
<p>Drag me around</p>
</div>
JavaScript
$( function() {
$( "#draggable" ).draggable();
containment: "parent";
} );
var containment = $( ".selector" ).draggable( "option", "containment" );
// Setter
$( "#draggable" ).draggable( "option", "containment", "parent" );