JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script>
<div id="top"></div>
<div id="child">
<div id="draggable"></div>
</div>
CSS
#top {
width:500px;
height:500px;
z-index:5;
background-color:rgba(255,0,0,0.5);
position:absolute;
}
#child {
width:300px;
height:300px;
z-index:4;
background-color:rgba(0,255,0,0.5);
position:absolute;
top:50px;
left:50px;
}
#draggable {
width:200px;
height:200px;
z-index:4;
background-color:rgba(0,0,255,0.5);
position:absolute;
top:10px;
left:10px;
}
JavaScript
$(function(){
$("#draggable").draggable({
containment: "child"
});
var oldValue= $("#top").css('z-index');
var newValue = $("#child").css('z-index')-1;
$("#top").hover(function(){$("#top").css('z-index',newValue)},
function(){$("#top").css('z-index',oldValue)});
});