wesnolte / Pajinate

A jQuery Pagination Plugin
http://th3silverlining.com/2010/04/15/pajination-a-jquery-pagination-plugin/
MIT License
207 stars 97 forks source link

Option to wrap around after last page #5

Closed Nevon closed 13 years ago

Nevon commented 13 years ago

A client wanted me to make the pagination wrap around after having reached the last page, so I figured I'd push the changes back upstream. I've simply added an option called wrap_around. If true, showNextPage() will go to page 0 after having reached the last page.

It doesn't make a whole lot of sense if you're using it for traditional paging with numbers and stuff, but in a situation like this, it makes quite a bit of sense.

wesnolte commented 13 years ago

Very cool, nice feature. Thanks!

Nevon commented 13 years ago

Just remember to update the docs to reflect this change. It's set to false by default, so it shouldn't lead to any unexpected surprises. But it's still a good idea to be thorough.

wesnolte commented 13 years ago

I changed it so now it works in reverse too i.e. prev will send you to the last page if the active page is the first page. I also added an option to remove the first and last navigation items.