The pagination plug-in of jQuery implements paging effects, and jquerypagination
Practical jQuery Paging special effect plug-in jquery. pagination. js, implemented based on jQuery, can call dynamic data through ajax Based on the pageselectCallback function callback. The current method is to generate JSON data to the JS file, and call the data in JSON format, the disadvantage is that the data is read at one time and the efficiency will be lower. The plug-in supports the custom configuration function of many parameters, which is still very good. You can make improvements based on your own ideas.
Usage:
1. Load plug-ins and jQuery
<link rel="stylesheet" href="pagination.css"> <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript" src="jquery.pagination.js"></script>
2. HTML content
Copy codeThe Code is as follows:
<Div class = "pagination"> </div>
3. function call
<script type="text/javascript"> function pageselectCallback(page_index, jq){ alert(page_index); return false; } $(document).ready(function(){ $(".pagination").pagination(100, { callback: pageselectCallback, num_edge_entries: 1, }); }); </script>
Parameter configuration explanation
Parameter name parameter description optional Default Value
Callback click the callback function () {return false ;}
When current_page is initialized, the selected page number is 0.
Items_per_page the number of records per page is 10
Link_to paging link string #
Num_display_entries: Maximum number of page numbers displayed: 11
Next_text 'Next page' the text string displayed Next
If next_show_always is set to false, the 'next page' button displays the Boolean value true only when the page number can be increased.
If prev_show_always is set to false, the 'previous page' button displays the Boolean value true only when the previous page is still accessible.
Prev_text the text string Previous displayed on the Previous page
If num_edge_entries is set to 1, the homepage and last page 1 or 0 are always displayed.
Ellipse_text identifies a string from the current page segment to the homepage or the last page...
If load_first_page is set to true, the callback function will execute a Boolean value true during plug-in initialization.
View DEMO plug-in download
The above is all the content of this article. I hope you will like it.