JSFiddle - React, Tailwind, and code Playground

HTML

<section style="height:5000px;">
    <div id="menu" style="position:fixed; top:5px; left:5px; width:200px; height:100px; display:block; background:#000"></div>
</section>

JavaScript

$(document).scroll(function(){  
    $('#menu').fadeOut(400);

    var scrollA = $('body').scrollTop();

    setTimeout(function(){
        if(scrollA == $('body').scrollTop()){
            $('#menu').fadeIn(400);
        }
    }, 750);
})