JSFiddle - React, Tailwind, and code Playground

by harsh dand

HTML

<p id="gifLoad" style="display:none">adasf</p>

<div style="height:800px;"></div>

JavaScript

function onScrolling{
    debugger;
    scroll_pos = $(window).scrollTop();     
    win_height = $(window).height();        
    doc_height = $(document).height();      

    if(scroll_pos + win_height > doc_height - 1000) {

        $('#gifLoad').show();
        $(window).unbind('scroll');

        setTimeout(function(){

            $('#gifLoad').hide();
            $(window).bind('scroll',onScrolling);     //<--- this doesn't work..

        }, 2000);
    }
}

$(window).on('scroll',onScrolling);