I have problem with my infinite scroll. I want execute load more before 300px of the bottom of the page.
I detect the scroll with :
$window.scroll(function(){
And in this function I have test this :
if (($document.height() - $window.height()) == $window.scrollTop()) {
But this works only when we are at footer.
Then I test this :
if ($(window).scrollTop() >= $(document).height() - $(window).height() - 300)
But the infinite scroll run several times between 300px and the bottom of the page.
After this, I want just test this :
if ($(window).scrollTop() == $(document).height() - $(window).height() - 300)
But this not working and I don't understand.
Do you have ideas ?
Thanks you so much