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

首頁 > 編程 > JavaScript > 正文

JS實現touch 點擊滑動輪播實例代碼

2019-11-19 17:51:46
字體:
來源:轉載
供稿:網友

廢話不多說了,直接給大家貼js代碼了,具體代碼如下所示:

<script src="../js/jquery-1.8.3.min.js"></script><script src="../js/jQuery.mobile-1.3.2.min.js"></script>----------------------需要應用jquery .mobile自行百度.num-zcon{  overflow: hidden;  width:auto;  height: 12.5em;}.num-container1 {    height: 12.5em;    background: url("icons/effect-img/13.png")no-repeat;        background-size: cover;    display:block;  }.num-container2 {   height: 12.5em;    background: url("icons/effect-img/15.png")no-repeat;        background-size: cover;      display:none;  }  .num-container3 {    height: 12.5em;    background: url("icons/effect-img/177.png")no-repeat;        background-size: cover;      display:none;  }  .num-container4 {    height: 12.5em;    background: url("icons/effect-img/18.png")no-repeat;        background-size: cover;      display:none;  }  .num-container5 {    height: 12.5em;    background: url("icons/effect-img/19.png")no-repeat;    background-size: cover;    display:none;  }  .num-float{    height:1em;    margin:0 auto;    z-index: 3;    text-align:center;    margin-top: -1.35em;  }  .num-a{    background:#ffffff;    height: 0.4375em;    width: 0.4375em;    border-radius: 50%;    float: left;    opacity: 0.5;  }   .num-kong{    height: 0.625em;    width: 0.25em;    float: left;  }  .num-kong-width{    width: auto;    height: 0.9375em;  }  .num-kong-win{    height: 0.625em;    width: 0.1em;    float: left;  }----------<div class="num-zcon">  <div class="num-container1" id="adv1">  </div>  <div class="num-container2" id="adv2">  </div>  <div class="num-container3" id="adv3">  </div>  <div class="num-container4" id="adv4">  </div>  <div class="num-container5" id="adv5">  </div>  <div class="num-float ub ub-ac ub-pc">    <div class="num-a" id="ab1">    </div>    <div class="num-kong">    </div>    <div class="num-a" id="ab2">    </div>    <div class="num-kong">    </div>    <div class="num-a" id="ab3">    </div>    <div class="num-kong">    </div>    <div class="num-a" id="ab4">    </div>    <div class="num-kong">    </div>    <div class="num-a" id="ab5">    </div>  </div></div><script>  //橫幅廣告;  var Nownumber = 1;//1圖;  var Maxnumber = 5;//總個數;  function show() {    for (var i = 1; i <= Maxnumber; i++) {      if (Nownumber == i) {        document.getElementById("adv" + Nownumber).style.display = 'block';        document.getElementById("ab" + Nownumber).style.opacity = 1;      }      else {        document.getElementById("adv" + i).style.display = 'none';        document.getElementById("ab" + i).style.opacity = 0.5;        document.getElementById("adv" + i).style.transition = "1s";      }    }    if (Nownumber == Maxnumber) {      Nownumber = 1;    }    else {      Nownumber++;    }  }  theTime = setInterval('show()', 5000);</script><script>$(document).on("pageinit","#pageone",function(){ $("#adv1").on("swiperight",function(){  $(this).hide();  Nownumber=5;  $("#adv5").show(); });    $("#adv5").on("swiperight",function(){  $(this).hide();  Nownumber=4;  $("#adv4").show(); });  $("#adv4").on("swiperight",function(){  $(this).hide();  Nownumber=3;  $("#adv3").show(); });  $("#adv3").on("swiperight",function(){  $(this).hide();  Nownumber=2;  $("#adv2").show(); });  $("#adv2").on("swiperight",function(){  $(this).hide();  Nownumber=1;  $("#adv1").show(); });  $("#adv1").on("swipeleft",function(){  $(this).hide();  Nownumber=2;  $("#adv2").show();  }); $("#adv2").on("swipeleft",function(){  $(this).hide();  Nownumber=3;  $("#adv3").show();  }); $("#adv3").on("swipeleft",function(){  $(this).hide();  Nownumber=4;  $("#adv4").show();  }); $("#adv4").on("swipeleft",function(){  $(this).hide();  Nownumber=5;  $("#adv5").show();  }); $("#adv5").on("swipeleft",function(){  $(this).hide();  Nownumber=1;  $("#adv1").show();});});</script>

以上所述是小編給大家介紹的JS實現touch 點擊滑動輪播實例代碼,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對武林網網站的支持!

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 治多县| 桐乡市| 张家港市| 得荣县| 万荣县| 望奎县| 武胜县| 防城港市| 比如县| 射阳县| 麻阳| 鄂伦春自治旗| 新疆| 田林县| 寿宁县| 咸宁市| 五华县| 嘉定区| 泰兴市| 柳林县| 葵青区| 宁明县| 丰宁| 射洪县| 绥中县| 城固县| 宁化县| 丹巴县| 顺义区| 凤台县| 醴陵市| 含山县| 海盐县| 红原县| 德清县| 台东县| 盐城市| 修文县| 鲜城| 望奎县| 云和县|