A jQuery plugin that allows you to quickly and easily paginate almost any set of elements on a page. Super-easy to implement, provides a very stripped down prev/next navigation elements with optional page count display.
Current version: 1.0.1
Dependancies: jQuery 1.2 or greater (may work with earlier releases but untested!)
Licence: Released under a MIT-style licence.
View the demo page for code samples and demonstrations.
The plugin can be used to paginate pretty much any set of elements on a page. Simply call the plugin on a jQuery DOM object collection once the DOM is ready and it will take care of the rest! A settings object can be passed in to customise the behaviour (see below for setting options).
The prev/next buttons will by default be placed after the last item in the collection, but you can easily change this by passing another jQuery DOM object collection in and the links will be appended within all of the specified elements.
The main settings options are as follows:
You can also customise the class names of the prev/next and counter elements in the settings object, should you not wish to use the defaults.
span that wraps the counter - default => qp_counterspan that wraps the total number of pages - default => "qp_totalnumber"span that wraps the current page count - default => "qp_pagenumber"
jQuery('.news_item').quickpaginate(); // would paginate all items on the page with the class of 'news_item'
jQuery('div#quick_slideshow img').quickpaginate(); // would paginate all img elements within the div with an id of 'quick_slideshow'
// Paginate everything with the class of "news_item",
// 5 per 'page' and without the page counter.
jQuery('.news_item').quickpaginate( { perpage: 5, showcounter: false } );
// Paginate all img elements and the element with the id of "info",
// with the prev/next/counter element appended to the element with the id of "pager_here"
jQuery('img, #info').quickpaginate({ pager : $("#pager_here") });
01.11.08 - 1.0.1 Release: Fixes bug due to extra closing div in pager (thanks to Brian Rhinehart)
28.10.08 - 1.0 Release.