亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

簡(jiǎn)單實(shí)現(xiàn)jQuery進(jìn)度條輪播實(shí)例代碼

 更新時(shí)間:2016年06月20日 08:57:08   作者:BackgroundColor  
這篇文章主要為大家詳細(xì)介紹了簡(jiǎn)單實(shí)現(xiàn)jQuery進(jìn)度條輪播實(shí)例代碼,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了jQuery進(jìn)度條輪播的具體實(shí)現(xiàn)代碼,供大家參考,具體內(nèi)容如下 
HTML: 

<div class="bannar">
      <div class="img">
        <ul>
          <li style="background:url(img/1.jpg);display:block;"></li>
          <li style="background:url(img/2.jpg);"></li>
          <li style="background:url(img/3.jpg);"></li>
          <li style="background:url(img/4.jpg);"></li>
        </ul>
      </div>
      <div class="text">
        <ul>
          <li>0</li>
          <li>1</li>
          <li>2</li>
          <li>3</li>
        </ul>
      </div>
      <div class="nav">
        <ul>
          <li><p></p></li>
          <li><p></p></li>
          <li><p></p></li>
          <li><p></p></li>
        </ul>
      </div>
    </div>

CSS: 

<style>
    *{
      margin:0 auto;
      padding:0;
    }
    
    .bannar{
      width:100%;
      height:490px;
      position:relative;
    }
    .img{
      width:100%;
      height:490px;
      overflow:hidden;
    }
    .img ul li{
      width:100%;
      height:490px;
      list-style-type: none;
      display:none;
    }
    .text{
      width:1000px;
      height:6px;
      position:absolute;
      bottom:28px;
      left:50%;
      margin-left:-500px;
    }
    .nav{
      width:1000px;

      height:10px;
      position:absolute;
      bottom:4px;
      left:50%;
      margin-left:-500px;
    }
    .text ul li{
      width:200px;
      height:100%;
      float:left;
      margin-left:38px;
      list-style-type: none;
      
    }
    .nav ul li{
      width:200px;
      height:10px;
      
      float:left;
      margin-left:38px;
      list-style-type: none;
      background:gray;
    }
    .nav ul li p{
      width:0px;
      height:100%;
      background:red;
      float:left;
    }
  </style>

Javascript: 

<script>
      var i=0;
      var time_id=null;
      function auto(){
        $(".nav ul li").eq(i).find("p").animate({
          "width":"200px"
        },3900,function(){
          i++;
          $(this).css("width", '0px');
          if(i>3){
            i=0;
          }
          $(".img ul li").eq(i).fadeIn(300).siblings().fadeOut(300);
        });
      }

      time_id=setInterval("auto()",4000);
      
      $(".text ul li").click(function(){
        $(".nav ul li").find("p").stop().css("width","0px");
        clearInterval(time_id);
        i=$(this).index();
        $(".img ul li").eq(i).fadeIn().siblings().fadeOut();
        auto();
        time_id=setInterval("auto()",4000);
      });

      $(".nav ul li").click(function(){
        $(".nav ul li").find("p").stop().css("width","0px");
        clearInterval(time_id);
        i=$(this).index();
        $(".img ul li").eq(i).fadeIn().siblings().fadeOut();
        auto();
        time_id=setInterval("auto()",4000);
      })
      
    </script>

效果圖:

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論