| 776 |
lars |
1 |
bootpag - dynamic pagination
|
|
|
2 |
============================
|
|
|
3 |
|
|
|
4 |
This jQuery plugin helps you create dynamic pagination with [Bootstrap](http://getbootstrap.com/) or in any other html pages.
|
|
|
5 |
|
|
|
6 |
#Example
|
|
|
7 |
|
|
|
8 |
Snippet that dynamic loads number of pages.
|
|
|
9 |
More examples can be found on [project homepage](http://botmonster.com/jquery-bootpag/)
|
|
|
10 |
|
|
|
11 |
```html
|
|
|
12 |
<p id="content">Dynamic page content</p>
|
|
|
13 |
<p id="pagination-here"></p>
|
|
|
14 |
```
|
|
|
15 |
|
|
|
16 |
```javascript
|
|
|
17 |
$('#pagination-here').bootpag({
|
|
|
18 |
total: 7, // total pages
|
|
|
19 |
page: 1, // default page
|
|
|
20 |
maxVisible: 5, // visible pagination
|
|
|
21 |
leaps: true // next/prev leaps through maxVisible
|
|
|
22 |
}).on("page", function(event, num){
|
|
|
23 |
$("#content").html("Page " + num); // or some ajax content loading...
|
|
|
24 |
// ... after content load -> change total to 10
|
|
|
25 |
$(this).bootpag({total: 10, maxVisible: 10});
|
|
|
26 |
});
|
|
|
27 |
|
|
|
28 |
```
|
|
|
29 |
#License
|
|
|
30 |
|
|
|
31 |
Plugin available under MIT license (see LICENSE.txt)
|