JSFiddle - React, Tailwind, and code Playground

HTML

<div id='head'>
  
</div>


<p>Scroll...</p>

CSS

html{
    height:2000px;
}
#head{
    position:fixed;
        top:0px;
    width:100%;
    font-size:3em;
}

JavaScript

//$(window).on('scroll', function(){
$(window).on( "head", "scroll", function() {
$("#head").html($(this).scrollTop()== $(document).height() - ($(window).height()))
   
         
});