Home > Web Front-end > JS Tutorial > body text

jquery plug-in web2.0 grid paging script, can be used for ajax non-refresh paging_jquery

WBOY
Release: 2016-05-16 18:57:07
Original
927 people have browsed it

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

Copy the code The code is as follows:

JackLee: paging:function(page){
location.href="?page=" page;
}
Is there any problem with this? ?
When you click on page 10, page 1 is the current one on the div navigation. I think page 10 should be the current one!
-------------------------------------------------- ---------
You didn't pay attention here:
---
Of course, in order to keep the page number position of the paging, you have to assign the current page number when refreshing the page. Give the parameter: current
. If you don’t assign a value to it, its default value is the first page. . .
---
You need to manually assign a value to it after reloading this page.
If you don’t want to do this, it will be better to use ajax to paginate, and it will not be too troublesome

Online demonstrationhttp://img.jb51.net/online/ jquery.pageFoot/DEMO.htm
File Packaginghttp://img.jb51.net/online/jquery.pageFoot/jquery.pageFoot.rar
Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!