JQuery plug in sharing pagination plug in jqPagination
- 2020-03-30 03:12:40
- OfStack
Usage:
Add the JS and CSS files for the jQuery class library, jqPagination plug-in
<link rel="stylesheet" href="jqpagination.css"/>
<script src="jquery-1.6.2.min.js"></script>
<script src="jquery.jqpagination.min.js"></script>
The following HTML is required
<div class="pagination">
<a href="#" class="first" data-action="first">«</a>
<a href="#" class="previous" data-action="previous">‹</a>
<input type="text" readonly="readonly" data-max-page="40" />
<a href="#" class="next" data-action="next">›</a>
<a href="#" class="last" data-action="last">»</a>
</div>
Finally, the plug-in is initialized
$('.pagination').jqPagination({
link_string : '/?page={page_number}',
current_page: 5, //Set the current page to 1 by default
max_page : 40, //Set the maximum page to 1 by default
page_string : ' The current first {current_page} page , A total of {max_page} page ',
paged : function(page) {
//Postback events...
}
});