This jQuery plug-in is an Ajax paging plug-in, which is loaded once, so there is no refresh or delay when switching between paging. This method is not recommended if the amount of data is large, because the loading will be slower. This article will share with you the usage and parameter introduction of the jQuery Pagination paging plug-in. Friends who are interested should take a look.
Introduction to the plug-in
This jQuery plug-in is an Ajax paging plug-in, one-time Loading, so there is no refresh or delay when switching between pages. This method is not recommended if the amount of data is large, because the loading will be slower.
The original plug-in CSS is not very reasonable and uses floats, so it cannot be conveniently positioned in the left and right directions, and the floats are not cleared. In the Chinese modified version, I optimized it to support text-align. position.
How to use
Like the general jQuery plug-in, this plug-in is also very simple and convenient to use. The method is pagination, for example $("#page").pagination(100);
Parameter
Parameter name |
Description |
Parameter value |
##maxentries | Total number of items | Required parameter, integer |
Number of entries displayed per page | Optional parameter, the default is 10 | |
The number of paging entries displayed in the main part of continuous paging | Optional parameter, the default is 10 | ##current_page | The currently selected page |
Optional parameter, the default is 0, indicating page 1 |
num_edge_entries |
The number of entries displayed on both sides of the first and last pages |
Optional parameter, the default is 0 |
link_to |
Page link |
String, optional parameter, default Is "#" |
##prev_text | ##The text displayed on the "Previous Page" paging buttonString parameter, optional, default is "Prev" | |
Text displayed on the "Next Page" paging button | String parameter, optional, the default is "Next" | |
What text is used to indicate the number of omitted pages | Optional string parameter, default is "..." |
|
prev_show_always |
Whether to display the "previous page" paging button |
Boolean type, optional parameter, the default is true, that is, the "previous page" button is displayed |
next_show_always |
Whether to display the "next page" paging button |
Boolean, optional Parameter, the default is true, which means the "next page" button is displayed |
callback |
Callback function |
No execution effect by default |
Example
For example, the following usage code:
$("#Pagination").pagination(56, { num_edge_entries: 2, num_display_entries: 4, callback: pageselectCallback, items_per_page:1 });
The meaning of this code is: there are a total of 56 (maxentries) list items, 2 (num_edge_entries) are displayed on both sides of the first and last pages, and 4 (num_display_entries) are displayed on the continuous page main body. The callback function is pageselectCallback (callback). Each The list items displayed on the page are 1 (items_per_page).
Related recommendations:
jQuery EasyUI API Chinese Document-Pagination_jquery
jQuery EasyUI Tutorial-Pagination(pagination)
MySQL paging model (Pagination.php)_MySQL
The above is the detailed content of Detailed explanation of jQuery Pagination paging plug-in. For more information, please follow other related articles on the PHP Chinese website!