1th Step: Analyzing the problem my side of the process is to automatically generate page numbers based on the number of data bars passed in, and the number of page numbers that need to be displayed. For example, if the parameter passed in is {pagesize:10,totalrow:200} Then there is a total of 20 pages.
First-generation page numbering style:
2nd step: Click on the action 2 or Next page button style:
3rd step: Generate a new page the number of pages visible here is 10. The code processing mechanism is, with 6 as median is the middle value, refresh the page number click 6 Style:
The 4th step: Click the page number after 6, or the next page button, will refresh the page, style:
HTML structure
<id= "pagination"> </div>
JS call Getdatafun for the action after the click, can be an AJAX request
$ ("#pagination"). Paging ({pagesize:10,totalrow:200,getdatafun:getdata})
The downside is that you need to rewrite the DOM every time you refresh the page. Should be the time to refresh the page only to change the number of pages, there is time to optimize--, the most recently written things are often used by some small features, novice. If there is a mistake, please correct the online preview. Is the need to own site or blog Park has this feature, I did not find
If necessary, complete code demo download Paging.zip
Realization of paging function based on jquery