JSFiddle - React, Tailwind, and code Playground
by Vitaliy T
HTML
<nav id="js_menu" class="hidden">Menu</nav>
<div class="content">
Some text here
</div>
CSS
nav{
position: fixed;
top: 0;
right: 0;
background-color: red;
padding: 10px;
}
.content{
min-height: 800px;
background-color: gainsboro;
}
.hidden{
display: none;
}
JavaScript
$(window).on('scroll mousemove', function(){
if($(('#js_menu:not(.hidden)')).length){
return 0;
}
$('#js_menu').toggleClass('hidden');
setTimeout(function(){
$('#js_menu').toggleClass('hidden');
},3000);
});