国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

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

2019-11-20 09:40:01
字體:
供稿:網(wǎng)友

本文實(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í)有所幫助,也希望大家多多支持武林網(wǎng)。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 黄陵县| 高台县| 黄陵县| 营山县| 高陵县| 饶平县| 江津市| 辽阳县| 上杭县| 务川| 泌阳县| 太白县| 德阳市| 文昌市| 精河县| 徐水县| 恭城| 曲沃县| 棋牌| 顺义区| 湖北省| 博乐市| 晴隆县| 井研县| 县级市| 沂源县| 江源县| 玉树县| 嵊泗县| 西昌市| 靖远县| 闻喜县| 温州市| 临泉县| 柳州市| 施秉县| 翁牛特旗| 临漳县| 崇信县| 调兵山市| 正阳县|