I implemented infinite scroll jquery plugin manually on my drupal website. I'm having an issue with a view that contains an exposed filter. Infinite scroll just keeps appending the same data.
For e.g: If at the time of page load our next page is "page=2" and last page is 5, in this case it simply appends the results of "page=2" to current results.
The "nextSelector"(.pager-next) points only to the next page in drupal. So the script loads the next page (e.g:page 2) over and over.
$container.infinitescroll({
navSelector : \'div.item-list ul.pager\', // selector for the paged navigation
nextSelector : \'div.item-list li.pager-next > a\', // selector for the NEXT link (to page 2)
itemSelector : \'.item\', // selector for all items you\'ll retrieve
bufferPx: 300,
pixelsFromNavToBottom: \'ul.pager\',
loading: {
msgText: \''.t('Loading More...').'\',
finishedMsg: \''.t('No more posts.').'\',
},
state: {
isDuringAjax: false,
isInvalidPage: false,
isDestroyed: false,
isDone: false, // For when it goes all the way through the archive.
isPaused: false,
currPage: 0
},