Skip to content

Commit

Permalink
Added 'none left' option for displaying a custom 'No more pages left'…
Browse files Browse the repository at this point in the history
… message.
  • Loading branch information
appel committed Aug 2, 2012
1 parent 9d6ff45 commit 6f53770
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.textile
Expand Up @@ -58,6 +58,11 @@ h3. next
*Default:* ".next"
Enter the selector of the link element that links to the next page. The href attribute of this element will be used to get the items from the next page. Make sure there is only one(1) element that matches the selector.

h3. noneleft

*Default:* false
Contains the message to be displayed when there are no more pages left to load.

h3. loader

*Default:* `<img src="images/loader.gif"/>`
Expand Down
7 changes: 6 additions & 1 deletion jquery.ias.js
Expand Up @@ -151,7 +151,11 @@
function paginate(curScrOffset, onCompleteHandler)
{
urlNextPage = $(opts.next).attr("href");
if (!urlNextPage) return stop_scroll();
if (!urlNextPage)
{
if (opts.noneleft) $(opts.container).find(opts.item).last().after(opts.noneleft);
return stop_scroll();
}

if (opts.beforePageChange && $.isFunction(opts.beforePageChange)) {
if (opts.beforePageChange(curScrOffset, urlNextPage) === false) return;
Expand Down Expand Up @@ -314,6 +318,7 @@
item: '.item',
pagination: '#pagination',
next: '.next',
noneleft: false,
loader: '<img src="images/loader.gif"/>',
tresholdMargin: 0,
history : true,
Expand Down

0 comments on commit 6f53770

Please sign in to comment.