These days have just developed a web application with Java, involving paging problems in the front-end design, the following is a summary of the Paging mode controlled by Javacript when handling the paging problem, summarizing it. Some pictures, if you have a friend who needs to send me E-mail, I will pack the entire file to you. Because it is not very complicated, it is not much described here.
/ ** * Sub-processing *
Title: RJ-PAGE
*
Description: RJ-PAGE V1.0
*
Copyright: CopyRight (C) 2004
*
Company: RJSoft
* @Author Thinker
Yanghuangming@rongji.com
* @version 1.0
* /
/ **
* @ Pagccount: Total number
* @ CurrentPage: Current page number
* @ URL: Page URL
* @ PageSize: The number of page numbers per page is displayed.
* /
Function Page (PageCount, CurrentPage, URL, PageSize) {
// Style initialization
VAR BGPIC_NO_REPEAT = 'Background-Repeat: no-repeat;';
VAR page_num = 'font-size: 9px; color: # 999999; text-decoration: none; text-align: center; cursor: hand; vertical-align: top;';
VAR page_num_cur = 'font-size: 9px; color: # ff0000; text-decoration: none; text-align: center; cursor: hand; vertical-align: top;';
// body area var first, last, numclass, pageid; var showtext = "; showtext = '
FigSt = PageCount-PageSize 1;
} else {
First = CurrentPage;
}
IF ((First PageSize) <= PageCount) {
Last = first Pagesize;
} else {
Last = PageCount 1;
}
} else {
FigSt = 1;
Last = PageCount 1;
}
FOR (VAR K = first; K
ShowText = '
'; ShowText ='
'; ShowText ='
'; ShowText ='
'; ShowText ='
'; ShowText ='
Total: ' PageCount ' '; ShowText ='
'; ShowText ='
'; ShowText =' '; showText ='
'; If (currentPage> 1) {pageId = currentPage-1; showText =' ';} showText =' '; if (currentPage> 1) {showText =' ';} showText =' '; pageId = 1; showText = ''; ShowText = ''; ShowText = ''; IF (PageCount> Pagesize) {IF (PageCount-CurrentPage
'; ShowText =' ShowText = '
'; // Pampered with the current page Display as the red, default if (k == currentpage) {NumClass = Page_Num_cur;} else {NumClass = Page_Num;}
'; ShowText ='
'; ShowText =' ' K ' '; ShowText =' '; ShowText ='
'; ShowText ='
'; ShowText =' ';} // End // ShowText ='
'; ShowText ='
'; ShowText ='
'; ShowText ='
'; ShowText =' '; showText ='
'; ShowText ='
'; ShowText ='
'; ShowText =' '; showText ='
'; if (CurrentPage)
PageID = CURRENTPAGE 1;
ShowText = '
';} showtext =' '; if (CurrentPage)
ShowText = '
"
}
ShowText = '
"
Document.write (ShowText);
}