欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

純JS實(shí)現(xiàn)輪播圖的示例分析-創(chuàng)新互聯(lián)

這篇文章主要介紹了純JS實(shí)現(xiàn)輪播圖的示例分析,具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

臺兒ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場景,ssl證書未來市場廣闊!成為創(chuàng)新互聯(lián)的ssl證書銷售渠道,可以享受市場價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18982081108(備注:SSL證書合作)期待與您的合作!

如下代碼:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>圖片輪播的效果</title>
  <style type="text/css">
    * {
      margin: 0;
      padding: 0;
      text-decoration: none;
    }
    body {
      padding: 20px;
    }
    #container {
      position: relative;
      width: 600px;
      height: 400px;
      border: 3px solid #333;
      overflow: hidden;
    }
    #list {
      position: absolute;
      z-index: 1;
      width: 4200px;
      height: 400px;
    }
    #list img {
      float: left;
      width: 600px;
      height: 400px;
    }
    #buttons {
      position: absolute;
      left: 250px;
      bottom: 20px;
      z-index: 2;
      height: 10px;
      width: 100px;
    }
    #buttons span {
      float: left;
      margin-right: 5px;
      width: 10px;
      height: 10px;
      border: 1px solid #fff;
      border-radius: 50%;
      background: #333;
      cursor: pointer;
    }
    #buttons .on {
      background: orangered;
    }
    .arrow {
      position: absolute;
      top: 180px;
      z-index: 2;
      display: none;
      width: 40px;
      height: 40px;
      font-size: 36px;
      font-weight: bold;
      line-height: 39px;
      text-align: center;
      color: #fff;
      background-color: RGBA(0, 0, 0, .3);
      cursor: pointer;
    }
    .arrow:hover {
      background-color: RGBA(0, 0, 0, .7);
    }
    #container:hover .arrow {
      display: block;
    }
    #prev {
      left: 20px;
    }
    #next {
      right: 20px;
    }
  </style>
</head>
<body>
<div id="container">
  <div id="list" >
    <img src="https://cache.yisu.com/upload/information/20200622/114/76902.jpg" alt="無縫滾動" />
    <img src="https://cache.yisu.com/upload/information/20200622/114/76902.jpg" alt="無縫滾動" />
    <img src="https://cache.yisu.com/upload/information/20200622/114/76902.jpg" alt="無縫滾動" />
    <img src="https://cache.yisu.com/upload/information/20200622/114/76904.jpg" alt="無縫滾動" />
    <img src="https://cache.yisu.com/upload/information/20200622/114/76902.jpg" alt="無縫滾動" />
    <img src="https://cache.yisu.com/upload/information/20200622/114/76902.jpg" alt="無縫滾動" />
    <img src="https://cache.yisu.com/upload/information/20200622/114/76902.jpg" alt="無縫滾動" />
  </div>
  <div id="buttons">
    <span index="1" class="on"></span>
    <span index="2"></span>
    <span index="3"></span>
    <span index="4"></span>
    <span index="5"></span>
  </div>
  <a href="javascript:;" rel="external nofollow" rel="external nofollow" id="prev" class="arrow">&lt;</a>
  <a href="javascript:;" rel="external nofollow" rel="external nofollow" id="next" class="arrow">&gt;</a>
</div>
<script type="text/javascript">
  window.onload=function(){
    var container = document.getElementById("container");
    var list = document.getElementById("list");
    var buttons = document.getElementById("buttons").getElementsByTagName('span');
    var prev = document.getElementById("prev");
    var next = document.getElementById("next");
    var index = 1;
   function animate(offset){
     var newLeft = parseInt(list.style.left) + offset;
     list.style.left = newLeft + 'px';
     if(newLeft<-3000){
       list.style.left= -600 +'px';
     }
     if(newLeft>-600){
       list.style.left = -3000 + 'px';
     }
   }
   function buttonsshow(){
     for(var i =0; i<buttons.length;i++){
       if(buttons[i].className == 'on'){
         buttons[i].className='';
       }
     }
     buttons[index-1].className='on';
   }
   prev.onclick = function(){
     index-=1;
     if(index<1)
     {
       index=5;
     }
     buttonsshow();
     animate(600);
   };
   next.onclick = function(){
     index+=1;
     if(index>5){
       index=1;
     }
     buttonsshow();
     animate(-600);
   };
   //自動播放
   var timer;
    function play(){
      timer= setInterval(function(){
        next.onclick();
      },1000)
    }
    play();
    function stop(){
      clearInterval(timer);
    }
    container.onmouseover=stop;
    container.onmouseout=play;
for(var i=0; i<buttons.length; i++){
  ( function(i){
      buttons[i].onclick=function(){
        var clickindex= parseInt(this.getAttribute('index'));
        var offset = 600*(index-clickindex);
        animate(offset);
        index = clickindex;
        buttonsshow();
      }
  })(i);
}
  }
</script>
</body>
</html>

感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“純JS實(shí)現(xiàn)輪播圖的示例分析”這篇文章對大家有幫助,同時(shí)也希望大家多多支持創(chuàng)新互聯(lián)建站,關(guān)注創(chuàng)新互聯(lián)網(wǎng)站建設(shè)公司行業(yè)資訊頻道,更多相關(guān)知識等著你來學(xué)習(xí)!

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)建站aaarwkj.com,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

新聞標(biāo)題:純JS實(shí)現(xiàn)輪播圖的示例分析-創(chuàng)新互聯(lián)
路徑分享:http://aaarwkj.com/article32/dohssc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供做網(wǎng)站、移動網(wǎng)站建設(shè)、標(biāo)簽優(yōu)化、關(guān)鍵詞優(yōu)化微信公眾號、外貿(mào)網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站建設(shè)網(wǎng)站維護(hù)公司
国产激情一区二区三区不卡| 成人在线一区二区三区观看| 亚洲欧美日韩1区2区| 蜜臀综合亚洲国产精品| 亚洲乱码一区二区免费版| 亚洲最色最黄大片在线视频| 91出品国产福利在线| 精品一二三四五区亚洲乱码| 一区二区三区高清av在线| 在线观看亚洲毛片网站| 国产在线视频不卡福利片| 野花日本免费高清完整| 日韩在线啊啊啊的视频| 三级黄色片免费久久久| 黑人巨大一区二区三区| 欧美日韩亚洲国产三级| 亚洲中文字幕女同系列av专区| 国产成人久久久精品一区| 黑人巨大亚洲一区二区久| 日本人妻内射一区二区| 超碰91人人在线青青草| 亚洲国产日朝欧美综合久久| 成人黄片在线免费播放| 免费国产三级在线观看| 亚洲熟妇av乱码在线| 国产18成人午夜视频在线观看| 精品亚洲在线一区二区| 欧美高清一区二区在线播放| 日韩视频精品一区二区| 亚洲国产成人精品女人| 国产日韩欧美 一区二区三区| 粗暴蹂躏中文一区二区三区| 亚洲av日韩高清在线观看| 草草视频在线观看网站| 最新欧美精品一区二区| 视频精品一区二区在线观看| 高清日韩精品视频在线观看| 99热这里只有精品最新| 不卡视频一区二区日韩| 日韩中文字幕视频一区| av人妻熟女少妇蒂亚|