MaltMaster
MaltMaster

Reputation: 758

jquery Infinite Scroll page number

I'm using a jQuery plugin called InfiniteScroll (https://github.com/paulirish/infinite-scroll) and I have a URL with this pattern: '/category/2/', when I paged the result I use the following pattern: "/category/2?page=2".

When Infinite Scroll makes de request, he increments the wrong number, in the case above, the request is: "/category/3?page=2" in place of "/category/2?page=3".

Anyone knows how workaround this?

Upvotes: 0

Views: 1082

Answers (2)

PK.
PK.

Reputation: 2631

Try using http://pengkong.github.io/jquery-auto-pagination/ it doesn't depend on the next page link format, running page numbers and/or fixed increments.

Upvotes: 0

doublesharp
doublesharp

Reputation: 27637

You need to set a custom pathParse option -

pathParse:function(path,nextPage){
   path = path.match(/category\/[0-9]*\?page=([0-9]*)/).slice(1);
   return path;
}

Upvotes: 1

Related Questions