I know it’s been a while. I started about 5 posts, but haven’t finished any of them…
Hopefully this makes up for it: as a treat for the new year, I thought a little jQuery plugin that I wrote would be handy for some people: please welcome Elpaginator!
What it does:
It looks for a
ol within a wrapper & adds pagination depending on the maximum number of items specified.
- paginates if there are more items than the user specified
- displays number of items left or pages, i.e. 1-10, 11-20, etc or 1, 2, etc
- html of pagination is fully configurable (wrapper need to contain class of
- the number of the list item if ordered list is used is correct (uses start attribute that is deprecated, but there is no real alternative yet as IE6 & 7 don’t support CSS for this yet)
- support for
- very lightweight (less than 200 lines WITH lots of comments)
This is how you initialise the pagination:
Possible Options are:
1 2 3 4 5 6 7
A live example of it working can also be seen on the new Top Gear site (look at the sidebar for the lap times table).