I use infinite scroll plugin ( the infinite-scroll ) with isotope jQuery and wondered whether it is possible to change the path using the user query as the user scrolls down the page to view more items.
Is there a way to access the path and change one of the request parameters. It gets to the ok path, returning the first set of elements for the first time, and after that it gets to the following pages, 1,2 3 ok, but using the same query parameters that I used for the first time, only updating the page number.
I would like to change one of the options when I click on page 3 or 4 in the following way:
var customPath = path + "?type=items&category=clothes&pageNumber=";
Am I approaching this wrong?
Here is my code:
$container.infinitescroll({
navSelector: '#page_nav',
nextSelector: '#page_nav a',
itemSelector: '.element',
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;
}
},
function (newElements) {
$container.isotope('appended', $(newElements));
});