Home > Web Front-end > JS Tutorial > Detailed explanation of jQuery Pagination paging plug-in

Detailed explanation of jQuery Pagination paging plug-in

小云云
Release: 2018-01-01 10:29:05
Original
2200 people have browsed it

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

##items_per_pageNumber of entries displayed per page Optional parameter, the default is 10##num_display_entries##current_page##The text displayed on the "Previous Page" paging buttonString parameter, optional, default is "Prev"next_textText displayed on the "Next Page" paging buttonString parameter, optional, the default is "Next"ellipse_textWhat text is used to indicate the number of omitted pages

Parameter name

Description

Parameter value

##maxentries

Total number of items

Required parameter, integer

The number of paging entries displayed in the main part of continuous paging

Optional parameter, the default is 10

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

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
});
Copy after login

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template