Note that there are some explanatory texts on larger screens.

plurals
  1. POInfinite scroll plugin modify the path with custom query
    text
    copied!<p>I am using the infinite scroll plugin (<a href="https://github.com/paulirish/infinite-scroll" rel="noreferrer">infinite-scroll</a>) 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.</p> <p>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.</p> <p>I would like to modify one of the parameter when hitting page 3 or 4 with something like this:</p> <pre><code>var customPath = path + "?type=items&amp;category=clothes&amp;pageNumber="; </code></pre> <p>Am I approaching this the wrong way?</p> <p>Here is my code:</p> <pre><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: "&lt;em&gt;Loading the next set of categories...&lt;/em&gt;", img: 'http://i.imgur.com/qkKy8.gif' }, pathParse: function (path, nextPage) { var customPath = path + "?type=items&amp;category=all&amp;pageNumber="; path = [customPath, '#contaner']; return path; } }, // call Isotope as a callback function (newElements) { $container.isotope('appended', $(newElements)); }); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload