metafizzy / infinite-scroll

📜 Automatically add next page
https://infinite-scroll.com
7.41k stars 1.74k forks source link

issue with history event of infinite scroll #896

Closed ajayk3 closed 3 years ago

ajayk3 commented 4 years ago

Hi,

We are using the infinite-scroll JS and using the following code

function InfiniteScroll() { var nextURL = listUrl[urlCount];
var $container = $('.articles').infiniteScroll({ path : function() { return nextURL; }, append : '.article', status : '.scroller-status', hideNav : '.pagination', loadOnScroll : false, scrollThreshold : false });

Now, when scrolling to second story, some dynamic ads got inserted between the story and while scrolling history got changed before 500 pixel of third story and so on...

As some ads got inserted dynamically between the story, so it increases the height of the story and third story URL got fired early

Please help, any help will be greatly appreciated.