I am using the infinite scroll plugin (infinite-scroll) with jQuery isotope and was wondering if it's possible to modify the path with custom query parameters as user scrolls down the page to view more items.
Is there a way to access the path and modify one of the query parameter. It's hitting the path ok for the first time returning the first set of items and after that it hitting the next pages , 1,2 3 ok but using the same query parameters I used for the first time only updating the page number.
I would like to modify one of the parameter when hitting page 3 or 4 with something like this:
var customPath = path + "?type=items&category=clothes&pageNumber=";
Am I approaching this the wrong way?
Here is my code:
$container.infinitescroll({
navSelector: '#page_nav', // selector for the paged navigation
nextSelector: '#page_nav a', // selector for the NEXT link (to page 2)
itemSelector: '.element', // selector for all items you'll retrieve
loading: {
finishedMsg: 'No more categories to load.',
msgText: "<em>Loading the next set of categories...</em>",
img: 'http://i.imgur.com/qkKy8.gif'
},
pathParse: function (path, nextPage) {
var customPath = path + "?type=items&category=all&pageNumber=";
path = [customPath, '#contaner'];
return path;
}
},
// call Isotope as a callback
function (newElements) {
$container.isotope('appended', $(newElements));
});