Infinite scroll plugin changes path with user request

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', // 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));
});
+5
1

, , , Rich, .

jquery.infinitescroll.js:

//line 67
 $.infinitescroll.prototype = {
       //My custom parameters
        pageType: "&type=items",
        categoryParam: "&category=shoes",
        /*  
            ----------------------------
            Private methods
            ----------------------------
            */

, :

retrieve: function infscr_retrieve(pageNum) {}

:

desturl = path.join(opts.state.currPage)

desturl = path.join(opts.state.currPage + $.infinitescroll.prototype.pageType + $.infinitescroll.prototype.categoryParam);

desturl.

, JavaScript, - :

$('#filters a').click(function () {
    $.infinitescroll.prototype.pageType = "&type=products" ;                  
    $.infinitescroll.prototype.pageType = "&category=clothes";                           
     return false;
});

.

, -.

+7

All Articles