Jquery plug-in Web2.0 split page script, which can be used for Ajax without refreshing pages

Source: Internet
Author: User

****** Generate JS paging footer ******
***** No sword )****
Modified on:
Add two parameters: displaynum and displaylastnum. You can customize the number of displayed pages.

Parameter: pagesize: 10 // Number of pages displayed per page
, Count: 0 // number of data entries
, CSS: "mj_pagefoot" // css Style Class
, Current: 1 // current page number
, Displaynum: 7 // number of intermediate page numbers
, Displaylastnum: 5 // number of last displayed pages
, Previous: "Previous Page" // display style of the previous page
, Next: "Next page" // display style of the next page
, Paging: NULL // callback function when a paging event is triggered

Usage:
$ ("Div"). pagefoot ({
Pagesize: 10,
Count: 500,
CSS: "mj_pagefoot ",
Previous: "<",
Next: "> ",
Paging: function (PAGE ){
Alert ("Current page" + Page + "page ");
}
});
AboveCodeAdd paging code to all Div
*/
Specifically, one of the parameters is paging.

1. This parameter is the action triggered when the page is paging. If you do not add something in this action, the page will not function normally, so you can add it like this:
Paging: function (PAGE ){
Location. href = "? Page = "+ page;
}
Of course, in order to maintain the position of the page number, you need to assign the current page number to the parameter: Current
If you do not assign a value to it, the default value is the first page...

2. If you add some load data actions, it will be treated as Ajax refreshing.
Paging: function (PAGE ){
// Ajax. loaddata (PAGE );
}
I have no technical skills. Do it as a trainer, haha.Copy codeThe Code is as follows: jacklee: Paging: function (PAGE ){
Location. href = "? Page = "+ page;
}
Is there a problem with this ??
When you click Page 10th, the page 1st on the DIV navigation is current. I think we should make the page 10th the current one!
--------------------------------------------------------
You did not pay attention here:
---
Of course, in order to maintain the position of the page number, you need to assign the current page number to the parameter: Current
If you do not assign a value to it, the default value is the first page...
---
You need to manually assign a value to this page after you reload the page.
If you don't want to do this, it will be better to use Ajax for paging, and it will not be too troublesome.

Online Demo http://img.jb51.net/online/jquery.pageFoot/DEMO.htm
File packaging http://img.jb51.net/online/jquery.pageFoot/jquery.pageFoot.rar

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.