Pageless is a jQuery plugin. As you scroll down you see more results coming back at you automatically. It provides an automatic pagination in an accessible way : if javascript is disabled your standard pagination is supposed to work.
currentPage
: current page (params[:page])distance
: distance to the end of page in px when ajax query is firedloader
: selector of the loader div (ajax activity indicator)loaderHtml
: html code of the div if loader not usedloaderImage
: image inside the loaderloaderMsg
: displayed ajax messagepagination
: selector of the paginator divs. (if javascript is disabled paginator is required)params
: paramaters for the ajax query, you can pass auth_token heretotalPages
: total number of pagesurl
: URL used to request more datascrape
: A function to modify the incoming data. (Doesn't do anything by default)complete
: A function to call when a new page has been loaded (optional)end
: A function to call when the last page has been loaded (optional)
In the example
directory you'll find a Rails app that just runs. It demonstrates the basic usage of pageless scrolling.
$ script/server
Then just navigate to http://localhost:3000 and enjoy!
In the example.rails3
directory you'll find a Rails 3 app that just runs. It demonstrates the basic usage of pageless scrolling.
$ bundle install
$ rails s
Then just navigate to http://localhost:3000 and enjoy!
$('#results').pageless({ totalPages: 10
, url: '/articles/'
, loaderMsg: 'Loading more results'
});