Closed bmlyon closed 5 years ago
I'm using a custom path function per documentation I've found. My problem is that the pages aren't numbered.
var nextPages = [ 'insertPageNameHere', 'anotherPage', 'oneMorePage' ]; var infiniteScrollContainer = document.querySelector('.container'); var infScroll = new InfiniteScroll( infiniteScrollContainer, { path: function() { return nextPages[ this.loadCount ]; }, append: '.post', checkLastPage: true, history: 'push', prefill: true });
When I manually navigate to the second or third page it starts nextPages over again because pageIndex defaults to 1.
How would I set the pageIndex from outside the InfiniteScroll function so that on page3 I can set the count to 3 for example?
PS: I'm using vanilla js rather than jQuery.
See #688 for a similar solution.
Thank you. I think I can piece something together with that approach.
I'm using a custom path function per documentation I've found. My problem is that the pages aren't numbered.
When I manually navigate to the second or third page it starts nextPages over again because pageIndex defaults to 1.
How would I set the pageIndex from outside the InfiniteScroll function so that on page3 I can set the count to 3 for example?
PS: I'm using vanilla js rather than jQuery.