You can follow me on @twitter or @github and you may also like filtrify

Options

containerID String

Default value: Required! (No default)

The ID of the container of the items you want to paginate. It can be an UL, OL, DIV etc.

first String || false

Default value: false

In this parameter you can customize the button for the first page in the navigation. By default this parameter is set to false so the 'first' button won't be created.

To set the name for this button you just have to pass it as a string. View example.

In case you want to use a custom element instead of the auto generated one, you can pass the selector for that element. View example.

previous String || false

Default value: "← previous"

Same as the parameter 'first' but for the button 'previous'.

next String || false

Default value: "next →"

Same as the parameter 'first' but for the button 'next'.

last String || false

Default value: false

Same as the parameter 'first' but for the button 'last'.

startPage Integer

Default value: 1

The page you want to be displayed first when the plugin is applied.

perPage Integer

Default value: 10

Number of items to be displayed per page. View example.

midRange Integer

Default value: 5

Number of page links to display at one time i.e. let's say you have a total of 50 pages, instead of displaying links to each and every page, we display a range of pages around the current page that we're on.

Just a note, the mid range value should be an odd number so the display is symmetrical, but it can also be even if you like.

startRange Integer

Default value: 1

Number of page links always visible at the beggining of the nav. For instance, if you set startRange to 3, page links 1, 2 and 3 will allways be visible no matter which is the current page.

Pages object properties:

pages.current
current page number
pages.interval
an object that contains two properties - interval.start and interval.end - corresponding to the midRange edges of pages in the navigation.
pages.count
total number of pages

Items object properties:

items.showing
jQuery collection of the items currentely being displayed
items.oncomming
jQuery collection of the items in the next page
items.range
an object that contains two properties - range.start and range.end - corresponding to the range of items currentely being displayed.
items.count
total number of items

See how to create a legend for your pagination here.

API

Jump to page

After initiating the plugin you can at any time show a specific page to your users. View example.

Destroy

After initiating the plugin you can destroy it. View example.

Fork me on GitHub