JSFiddle - React, Tailwind, and code Playground
HTML
<div id="background">
<div id="blue"></div>
<div id="red"></div>
<div id="transparent"></div>
</div>
CSS
#red{
position:absolute;
top: 20px;
left: 20px;
width: 60px;
height: 30px;
background-color:red;
cursor: pointer;
z-index: 1;
}
#blue{
position:absolute;
top: 20px;
left: 20px;
width: 60px;
height: 30px;
background-color:blue;
cursor: pointer;
}
#transparent {
position:absolute;
top: 20px;
left: 20px;
width: 60px;
height: 30px;
background-color:none;
cursor: pointer;
z-index: 2;
}
#background{
position: relative;
margin: 0 auto;
width:300px;
height: 300px;
border: 1px solid;
border-color:#CCC;
text-align: center;
cursor: pointer;
}
JavaScript
$(function(){
$("#transparent").hover(function() {
$("#red").stop().fadeOut();
}, function() {
$("#red").fadeIn("normal");
});
})