If you want to upload your content when you reach the lowest level of the document, use the following code:
$(window).scroll(function() { if($(window).scrollTop() == $(document).height() - $(window).height()) {
If you want to download content before using up to 100 low-level pixels
var loading= false; $(window).scroll(function() { if (!loading && ($(window).scrollTop() > $(document).height() - $(window).height() - 100)) { loading= true;
Anoop source share