Home > Article > Web Front-end > jquery plug-in web2.0 grid paging script, can be used for ajax non-refresh paging_jquery
******Generate js footer******
****No Sword (2008-03-05)****
Modification date: 2008-3-12
Add two parameters: displaynum, displaylastNum. You can freely customize the number of displayed page numbers
Parameters: pagesize:10 //Number of page numbers displayed on each page
, count:0 //Number of data items
, css:"mj_pagefoot" //Page footer css style class
,current:1 //Current page number
,displaynum:7 //The number of page numbers displayed in the middle
,displaylastNum:5 //The number of last displayed page numbers
,previous:"previous page" //Previous page display style
,next:"next page" //Next page display style
,paging:null //callback when paging event is triggered Function
is used:
$("div").pagefoot({
pagesize:10,
count:500,
css:"mj_pagefoot",
previous: "<",
next:">",
paging:function(page){
alert("current page "page");
}
});
The above code adds paging footer code to all divs
*/
One of the parameters should be explained in particular: paging
1 This parameter is the action triggered when the paging footer is paging. If you don’t add something to this action, the paging will not work normally, so you can add it like this:
paging:function(page){
location.href="?page=" page;
}
Of course, in order to maintain the page number position of the paging, you must assign the current page number to the parameter: current
when refreshing the page. If you do not assign a value to it, its default value is Page 1. . .
2 If you add some load data actions, it can be regarded as ajax without refresh, haha
paging:function(page){
//ajax.loaddata(page);
}
No technical content, just practice, haha