【快手解释源码】【多说源码】【append 源码】paginator源码

2024-11-26 19:38:38 来源:源码安装tomcat 分类:探索

1.asp.net 分页代码 首页 上一页 1 2 3 4 5 >> …… 30 下一页 尾页

paginator源码

asp.net 分页代码 首页 上一页 1 2 3 4 5 >> …… 30 下一页 尾页

       <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

       <html xmlns="http://www.w3.org//xhtml" xml:lang="gb" >

       <head>

        <meta http-equiv="content-type" content="text/html; charset=gb" />

        <meta name="author" content="Smiling Dolphin" />

        <meta name="keywords" content="design,快手解释源码 css, cascading, style, sheets, xhtml, graphic design, w3c, web standards, visual, display, java, javascript, c++, php, jsp, asp, py, pl" />

        <meta name="description" content="my favorites language." />

        <meta name="robots" content="all" />

        <title>仿豆瓣分页原型(Javascript版)</title>

        <style type="text/css" title="currentStyle" media="screen">

        /* Paginator */

        .paginator {

        font: .8px normal Arial, Helvetica, sans-serif;

        color: #;

        margin-top: px;

        margin-bottom: 5px;

        line-height: %;

        background-color: #EEFFEE;

        text-align: center;

        }

        .paginator a, .thispage, .break {

        padding: 2px 4px;

        }

        .paginator .prev {

        margin-right: px;

        }

        .paginator .next {

        margin-left: px;

        }

        .paginator .count {

        margin-left: px;

        font-size: px;

        }

        </style>

       </head>

       <body>

       <div id="pagebar" class="paginator"></div>

       <script language="javascript" type="text/javascript">

       function QueryString(item){

        var sValue=location.search.match(new RegExp("[\?\&]"+item+"=([^\&]*)(\&?)","i"))

        return sValue?sValue[1]:sValue

       }

       var count = ;

       var perpage = ;

       var currentpage = QueryString("page");

       if (currentpage==null){

        currentpage = 1;

       }else{

        currentpage = parseInt(currentpage);

       }

       var pagecount = Math.floor(count/perpage);

       if(perpage*pagecount!=count)pagecount++;

       var pagestr = "";

       var breakpage = 9;

       var currentposition = 4;

       var breakspace = 2;

       var maxspace = 4;

       var prevnum = currentpage-currentposition;

       var nextnum = currentpage+currentposition;

       if(prevnum<1) prevnum = 1;

       if(nextnum>pagecount) nextnum = pagecount;

       pagestr += (currentpage==1)?'<span class="prev">< 前页</span>':'<span class="prev">< <a href="?page='+(currentpage-1)+'">前页</a></span>';

       if(prevnum-breakspace>maxspace){

        for(i=1;i<=breakspace;i++)

        pagestr += '<a href="?page='+i+'">'+i+'</a>';

        pagestr += '<span class="break">...</span>';

        for(i=pagecount-breakpage+1;i<prevnum;i++)

        pagestr += '<a href="?page='+i+'">'+i+'</a>';

       }else{

        for(i=1;i<prevnum;i++)

        pagestr += '<a href="?page='+i+'">'+i+'</a>';

       }

       for(i=prevnum;i<=nextnum;i++){

        pagestr += (currentpage==i)?'<span class="thispage">'+i+'</span>':'<a href="?page='+i+'">'+i+'</a>';

       }

       if(pagecount-breakspace-nextnum+1>maxspace){

        for(i=nextnum+1;i<=breakpage;i++)

        pagestr += '<a href="?page='+i+'">'+i+'</a>';

        pagestr += '<span class="break">...</span>';

        for(i=pagecount-breakspace+1;i<=pagecount;i++)

        pagestr += '<a href="?page='+i+'">'+i+'</a>';

       }else{

        for(i=nextnum+1;i<=pagecount;i++)

        pagestr += '<a href="?page='+i+'">'+i+'</a>';

       }

       pagestr += (currentpage==pagecount)?'<span class="next">后页 ></span>':'<span class="next"><a href="?page='+(currentpage+1)+'">后页</a> ></span>';

       document.getElementById("pagebar").innerHTML = pagestr;

       </script>

       </body>

       </html>

更多资讯请点击:探索

热门资讯

logo识别 源码_logo识别器

2024-11-26 19:15982人浏览

毫秒源码_毫秒代码

2024-11-26 18:581637人浏览

比特源码_比特源码站

2024-11-26 18:57817人浏览

aiui源码

2024-11-26 17:512490人浏览

biu源码

2024-11-26 17:481940人浏览

推荐资讯

小程序论坛源码_小程序论坛源码怎么用

1.买源码哪个网站比较靠谱?推荐几个国内精品靠谱的商业源码采购平台2.校园小情书微信小程序源码/社区小程序前后端开源/校园表白墙交友小程序3.php宝塔搭建部署小程序h5圈子论坛uniapp源码买源码