JSFiddle - React, Tailwind, and code Playground
HTML
<div class="stage">
<div class="bar"></div>
</div>
CSS
.stage{
height:400px;
width:auto;
background:#ccc;
}
.bar{
height:20px;
width:auto;
background:#000;
display:none;
}
JavaScript
var countdown;
$(".stage").hover(function() {
$(".bar").fadeIn();
fadeOutBar();
}, function(e){
$(".bar").fadeOut();
});
$('.stage').mousemove(function() {
$(".bar").fadeIn();
fadeOutBar();
});
function fadeOutBar() {
countdown = setTimeout(function() {
$(".bar").fadeOut();
}, 2000);
}