window.addEventListener('scroll',()=>{ let scrollTop = document.documentElement.scrollTop||document.body.scrollTop ; let clientHeight = document.documentElement.clientHeight || document.body.clientHeight ; let scrollHeight = document.documentElement.scrollHeight||document.body.scrollHeight ; if(Math.round(scrollTop+clientHeight) == scrollHeight){ $('.load-more').click(); } });