Detect when scroll position is at the bottom of page
$(window).scroll(function(){
var pageHeight = $(document).height(),
windowHeight = $(window).height(),
topDistance = $(document).scrollTop();
if( pageHeight - topDistance == windowHeight) {
//load more content now
console.log('reached the bottom');
}
});