****** 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