JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<div class="content">
<div class="content-table" style="height: 1000px;"></div>
<div id="draggable" class="ui-widget-content">
<p>Drag me around</p>
</div>
</div>
CSS
.content {
position: absolute;
top: 10px;
left: 10px;
right: 10px;
bottom: 10px;
overflow-y: scroll;
border: 1px solid green;
}
.content-table {
border: solid 2px red;
}
#draggable { position: absolute; top: 0px; width: 150px; height: 150px; padding: 0.5em; }
JavaScript
$(function() {
$("#draggable").draggable({
containment: ".content",
scroll: true
});
});