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

Added option in nav_label_info to display the current page and the numbe... #29

Closed gtraxx closed 11 years ago

gtraxx commented 12 years ago

...r of pages.

Very handy for paging with a specific graphic.

Example : $('#list-example').pajinate({ show_first_last:false, nav_label_info: 'Page {3} sur {4}', items_per_page : 4, item_container_id: '#paginate_properties', abort_on_small_lists: true, nav_label_prev : 'Précedent', nav_label_next : 'Suivant' });

tarlepp commented 12 years ago

There is a bug in your code, you have one extra ) -character in replace section. Corrected code below:

$page_container.find(options.nav_info_id).html(options.nav_label_info.replace("{0}", start_from + 1). replace("{1}", start_from + items.length).replace("{2}", $items.length).replace("{3}", $current_page).replace("{4}", $number_of_pages));

gtraxx commented 12 years ago

Will you added the change in pajinate?

The patch is available here: https://github.com/gtraxx/Pajinate

Best regards

wesnolte commented 11 years ago

Thanks for the contribution :+1:

gtraxx commented 11 years ago

:)