A relatively light and easy to use JS page plug-in, Ajax can be URL

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.