JSFiddle - React, Tailwind, and code Playground

by kougiland

HTML

<div id="container"><div class="loadedcontent"></div></div>

CSS

.loadedcontent {min-height: 3000px; }

JavaScript

var processing;

$(document).ready(function(){

    $(document).scroll(function(e){

        if (processing)
            return false;

        if ($(window).scrollTop() >= $(document).height() - $(window).height() - 700){
            processing = true;
            $.post('/echo/html/', 'html=<div class="loadedcontent">new div</div>', function(data){
                $('#container').append(data);
                processing = false;
            });
        }
    });
});