In fact, this function mainly involves four functional points.
1. Implementation of the home page Function
<A href = "javascript: gotopage (1)" Title = "Homepage" style = "cursor: hand;">
</A>
2. Implementation of the last page Function
<A href = "javascript: gotopage ($ {pagecount})" Title = "last page" style = "cursor: hand;">
</A>
3. Implementation of page numbers near the current page in the middle
<S: iterator begin = "% {beginpageindex}" End = "% {endpageindex}" Var = "num"> <! -- Num: Do not miss it. It is used to record the number between beginindex and endpageindex -->
<S: If test = "# num = currentpage">
<SPAN class = "pageselectornum pageselectorselected" >$ {num} </span>
</S: If>
<S: else>
<SPAN class = "pageselectornum" style = "cursor: hand;" onclick = "gotopage ($ {num});" >$ {num} </span>
</S: else>
</S: iterator>
4. Transfer to function implementation
<Select onchange = "gotopage (this. Value)">
<S: iterator begin = "1" End = "% {pagecount}" Var = "num">
<Option value = "$ {num}" >$ {num} </option>
</S: iterator>
</SELECT>
<! -- The following code implements "go to" display as current page -->
<SCRIPT type = "text/JavaScript">
$ ("# _ PN"). Val ("$ {currentpage }");
</SCRIPT>
5. The implementation of Jump functions is as follows:
<SCRIPT type = "text/JavaScript">
Function gotopage (pagenum ){
Window. Location. href = "topic_show.action? Id =$ {ID} & pagenum = "+ pagenum;
}
</SCRIPT>