最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jQuery+css實(shí)現(xiàn)的換頁(yè)標(biāo)簽欄效果

 更新時(shí)間:2016年01月27日 11:02:19   作者:m1870164  
這篇文章主要介紹了jQuery+css實(shí)現(xiàn)的換頁(yè)標(biāo)簽欄效果,涉及jQuery動(dòng)態(tài)操作頁(yè)面元素構(gòu)造換頁(yè)標(biāo)簽的相關(guān)技巧,需要的朋友可以參考下

本文實(shí)例講述了jQuery+css實(shí)現(xiàn)的換頁(yè)標(biāo)簽欄效果。分享給大家供大家參考,具體如下:

運(yùn)行效果截圖如下:

具體代碼如下:

<!DOCTYPE html>
<html>
 <head>
  <title>index</title>
  <script type="text/javascript" src="jquery.js"></script>
  <style type="text/css" >
   body {
    margin:0; padding:0; font-size:12px; color:gray;
   }
   .container {
    height:200px; background:#F2F2F2; border-radius:6px;
    -webkit-border-radius:6px; -moz-border-radius:6px; border:6px solid #D5D5D5; 
   }
   .wrapper {
    width:90%; margin:0px auto;
   }
   .pageContainer {
    margin:0 auto; height:30px; position:relative; width:100%;
   }
   .page {
    width:30px; height:30px; background:#494949; border-radius:30px; margin-left:5px;
    -webkit-border-radius:30px; -moz-border-radius:30px; line-height:30px; font-size:15px;
    display:block; text-align:center; color:#fff; float:left; cursor:pointer; float:left;
    margin-top:5px;
   }
   .page:hover {
    background:#42CFFD; font-weight:bolder;
   }
   .page.active {
    background:#0864C0; 
   }
  </style>
  <script type="text/javascript" >
   (function(){
    $.fn.pageCreate = function(url, allPage, currentPage, pageTarget){
     if(isNaN(allPage) || allPage < 1 || isNaN(currentPage) || currentPage < 1 || $.trim(url) == "") {
      return;
     }
     var html = [],
      self = $(this),
      pageTarget = pageTarget?"":""
      prevPage = currentPage > 1 ? currentPage - 1 : 0,
      nextPage = currentPage < allPage ? currentPage + 1 : 0
      left = '<a target="'+pageTarget+'" class="page" href="'+url+'1">&lt;&lt;</a><a target="'+pageTarget+'" href="'+(prevPage==0?"javascript:void(0)":url+prevPage)+'" class="page">&lt</a>',
      right = '<a target="'+pageTarget+'" href="'+(nextPage==allPage?"javascript:void(0)":url+prevPage)+'" class="page">&gt;</a><a target="'+pageTarget+'" class="page" href="'+url+allPage+'" >&gt;&gt;</a>';
     html.push('<div class="pageContainer">');
     html.push(left);
     for(var i=currentPage; i<=allPage; i++) {
      html.push('<a href="'+url+i+'" target="'+pageTarget+'" class="page '+(i==currentPage?"active":"")+'">'+i+'</a>');
     }
     html.push(right);
     html.push('</div>');
     self.html(html.join(''));
    };
   })();
   $(document).ready(function(){
    $('#pageContainer').pageCreate("http://localhost/?page=", 5, 3, '_blank');
   });
  </script>
 </head>
 <body>
  <div class="wrapper">
   <div class="container" id="pageContainer">
   </div>
  </div>
 </body>
</html>

更多關(guān)于jQuery特效相關(guān)內(nèi)容感興趣的讀者可查看本站專題:《jQuery常見經(jīng)典特效匯總》及《jQuery動(dòng)畫與特效用法總結(jié)

希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

休宁县| 蒙阴县| 伊吾县| 无极县| 漠河县| 鹿邑县| 贺兰县| 城固县| 抚宁县| 开远市| 获嘉县| 广德县| 准格尔旗| 襄垣县| 河池市| 交口县| 九龙坡区| 临高县| 涿鹿县| 淮阳县| 丰都县| 鄯善县| 延吉市| 西和县| 武邑县| 梨树县| 左云县| 普格县| 梧州市| 长兴县| 盐边县| 广丰县| 红安县| 德兴市| 墨江| 邢台县| 湛江市| 尉氏县| 卓资县| 北碚区| 新乐市|