I was planning to create the effect like when watching video (like Youtube), the mouse is not moving for few second the bottom bar and cursor will automatically hidden, if moving mouse again cursor and bar will show automatically. Any suggestion do do that ? Thanks
var countdown;
$(".stage").hover(function() {
$(".bar").fadeIn();
clearTimeout(countdown);
});
countdown = setTimeout(function() {
$(".bar").fadeOut();
}, 5000);
$(".stage").hover(
function(e){ $(".bar").fadeIn(); }, // over
function(e){ $(".bar").fadeOut();
} // out
);
.stage{
height:400px;
width:auto;
background:#ccc;
}
.bar{
height:20px;
width:auto;
background:#000;
display:none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="stage">
<div class="bar"></div>
</div>