JSFiddle - React, Tailwind, and code Playground
by wdm954
HTML
<div id="bg"></div>
<div id="content">
here is some content
</div>
CSS
div {
position: absolute;
}
#bg {
width: 300px;
height: 200px;
background-color: #ccc;
display:none;
}
#content {
width: 300px;
height: 200px;
padding: 10px;
}
JavaScript
$('#bg').fadeTo(1, 0);
$('#content').hover(function() {
$('#bg').stop().fadeTo(300, 0.7);
}, function() {
$('#bg').stop().fadeTo(300, 0);
});