Simple Boostrap Pagination Plugin With jQuery - Download Simple Boostrap Pagination Plugin With jQuery

Download Simple Boostrap Pagination Plugin With jQuery

Posted on

This time I will share jQuery Plugin and tutorial about Simple Boostrap Pagination Plugin With jQuery, hope it will help you in programming stack.

Simple Boostrap Pagination Plugin With jQuery - Download Simple Boostrap Pagination Plugin With jQuery
File Size: 7.1 KB
Views Total: 6050
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A lightweight and easy-to-use jQuery plugin that allows you to page the large text content using Bootstrap‘s pagination component.

How to use it:

1. Load the necessary jQuery and Bootstrap framework in the html page.

1 <link rel="stylesheet" href="/path/to/bootstrap.min.css">
2 <script src="/path/to/jquery.min.js"></script>
3 <script src="/path/to/bootstrap.min.js"></script>

2. Load the simple-bootstrap-paginator.js script after jQuery library.

1 <script src="simple-bootstrap-paginator.js"></script>

3. Create a container for the pagination plugin.

1 <div id="pagination" class="text-center"></div>

4. Render a default Bootstrap pagination inside the container you created.

1 var pag = $('#pagination').simplePaginator({
2     // options here
3 });

5. All configuration options with default values.

01 var pag = $('#pagination').simplePaginator({
02  
03     // the number of total pages
04     totalPages: 7,
05  
06     // maximum of visible buttons
07     maxButtonsVisible: 5,
08  
09     // page selected
10     currentPage: 1,
11  
12     // text labels for buttons
13     nextLabel: 'next',
14     prevLabel: 'prev',
15     firstLabel: 'first',
16     lastLabel: 'last',
17  
18     // specify if the paginator click in the currentButton
19     clickCurrentPage: true,
20  
21     // called when a page is changed.
22     pageChange: function(page) { console.log(page) }
23  
24 });

6. API methods.

1 // set totalPages option
2 pag.simplePaginator('setTotalPages', 10);
3  
4 // go to page 3
5 pag.simplePaginator('changePage', 3);

Changelog:

2019-01-30

  • adding bootstrap classes to li and a tags

2016-03-20

  • setPageFn fix

2016-01-15

  • added hide function and usage example
  • some methods changes

2016-01-14

  • added hide function

This awesome jQuery plugin is developed by jorgefernando1. For more Advanced Usages, please check the demo page or visit the official website.

source : jquery.net