Activate script after scrolling

Example of script that activates after scrolling to the end of site.

<script type='text/javascript'> 
jQuery(document).ready(function($) { 
    var loading= false;
    jQuery(window).scroll(function() {
        if (!loading && (jQuery(window).scrollTop() >  jQuery(document).height() - jQuery(window).height() - 500)) {
            loading= true;
            console.log('sss');
        }
    });
});
</script>

Leave a Reply

Your email address will not be published. Required fields are marked *