The pagination plug-in of jQuery implements paging effects, and jquerypagination

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.