var Pagenav = Pagenav | | {};p Agenav.fn = Null;pagenav.pre = "Pre";p Agenav.next = "Next";p Agenav.nav = function (A, b) {if (1 >= b) return thi S.PN = THIS.P = 1, THIS.PHTML2 (1); b < a && (a = b); var c = ""; 1 >= a? A = 1: (c + = this.phtml (A-1, B, Pagenav.pre), C + = this.phtml (1, B, "1")); THIS.P = A; THIS.PN = b; var d = 2, E = 9 > B? B:9; 7 <= a && (c + = "...", d = a-4, E = a + 4, E = b < e?) B:E); for (; d < A; d++) c + = this.phtml (d, b); c + = THIS.PHTML2 (a); for (d = a + 1; d <= e; d++) c + = this.phtml (d, b); E < b && (c = c + "..." + this.phtml (b, b)); A < b && (c + = this.phtml (A + 1, B, Pagenav.next)); Return C};p agenav.phtml = function (A, B, c) {return ' <a href= ' javascript:pageNav.go ("+ A +", "+ B +"); ' class= ' Pagenum ' > ' + (c | | a) + "</a>"};p agenav.phtml2 = function (a) {return "<span class= ' Cpagenum ' >" + A + "</span>"};p Agenav.go= function (A, b) {document.getElementById ("Pagenav"). InnerHTML = This.nav (A, b); Null! = This.fn && This.fn (THIS.P, THIS.PN)};/* <style>. pagenum{border:1px solid #999;p adding:2px 8px;dis Play:inline-block;} . cpagenum{font-weight:bold;padding:2px 5px;} #pageNav a:hover{text-decoration:none;background: #fff4d8;} </style > *//$ (function () {//for jquery window.onload = (function () {//optional set pagenav.pre= "PRE3"; pagenav.next= "next";/ /p:current page number. Pn:page sum. Pagenav.fn = function (P,PN) {document.getElementById ("test"). InnerHTML = "page:" +p+ "of" +PN + "pages."; $ ("#test"). Text ("page:" +p+ "of" +PN + "pages."); For jquery}; Goto the Page 3 of 33. Pagenav.go (3,53); });*/
Official address: https://code.google.com/p/page-nav-js-jquery/
A relatively light and easy to use JS page plug-in, Ajax can be URL