zoukankan      html  css  js  c++  java
  • swiper,一个页面使用多个轮播

    代码示例:

    <html>
    <head>
      <link href="https://cdn.bootcss.com/Swiper/4.3.0/css/swiper.min.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    
    
    <!--轮播111-->
    <div style="height:100px" class="swiper-container banner1">
      <div class="swiper-wrapper">
           
            <div class="swiper-slide"><a href='' class="fl"><img src="http://bpic.588ku.com/back_pic/05/09/30/9259840b8605406.jpg!r850/fw/800" width="100%" height="100px" alt="111" /></a></div>
         
            <div class="swiper-slide"><a href='' class="fl"><img src="http://bpic.588ku.com/back_pic/05/09/30/9259840b8605406.jpg!r850/fw/800" width="100%" height="100px" alt="广告2" /></a></div>
         
            <div class="swiper-slide"><a href='' class="fl"><img src="http://bpic.588ku.com/back_pic/05/09/30/9259840b8605406.jpg!r850/fw/800" width="100%" height="100px" alt="淘宝" /></a></div>
         
      </div>
        <!-- 分页器 -->
        <div class="swiper-pagination"></div>
    </div>
    
    
    
    <br>
    <br>
    <br>
    
    
    <!--轮播222-->
    <div style="height:100px" class="swiper-container banner2">
      <div class="swiper-wrapper">
           
            <div class="swiper-slide"><a href='' class="fl"><img src="http://bpic.588ku.com/back_pic/05/09/30/9259840b8605406.jpg!r850/fw/800" width="100%" height="100px" alt="111" /></a></div>
         
            <div class="swiper-slide"><a href='' class="fl"><img src="http://bpic.588ku.com/back_pic/05/09/30/9259840b8605406.jpg!r850/fw/800" width="100%" height="100px" alt="广告2" /></a></div>
         
      </div>
        <!-- 分页器 -->
        <div class="swiper-pagination"></div>
    </div>
    
    
    <br>
    <br>
    <br>
    
    
    <!--轮播333-->
    <div style="height: 120px" class="swiper-container banner3">
      <div class="swiper-wrapper">
           
            <div class="swiper-slide"><a href='' class="fl"><img src="http://bpic.588ku.com/back_pic/05/09/30/9259840b8605406.jpg!r850/fw/800" width="100%" height="100px" alt="111" /></a></div>
         
            <div class="swiper-slide"><a href='' class="fl"><img src="http://bpic.588ku.com/back_pic/05/09/30/9259840b8605406.jpg!r850/fw/800" width="100%" height="100px" alt="广告2" /></a></div>
         
      </div>
        <!-- 分页器 -->
        <div class="swiper-pagination"></div>
    
    </div>
    
    
    
    
    <script src="https://cdn.bootcss.com/Swiper/4.3.0/js/swiper.min.js" type="text/javascript"></script>
    <script>
    
    /*轮播111*/
    var mySwiper = new Swiper('.banner1', {
        autoplay: true,//可选选项,自动滑动
        pagination: {
        el: '.swiper-pagination',
      },
    })
    
    /*轮播222*/
    var mySwiper = new Swiper('.banner2', {
        // autoplay: true,//可选选项,自动滑动
        pagination: {
        el: '.swiper-pagination',
      },
    })
    
    
    
    /*轮播333*/
    var mySwiper = new Swiper('.banner3', {
        // autoplay: true,//可选选项,自动滑动
        pagination: {
        el: '.swiper-pagination',
      },
    })
    
    </script>
    
    </body>
    </html>
    

      

  • 相关阅读:
    jsp类的封装集合的应用及servlet的引入和JSTL的引入
    jsp学习1
    小型世界关系图的交互可视化(未完成)
    c++产生随机数问题
    socket error
    opengl空间画圆柱体
    socket连接服务器立即返回,不用三次握手
    win7电脑分无线网,简称热点
    设置ipv6全球地址和默认网关
    网线制作,水晶头里的线顺序
  • 原文地址:https://www.cnblogs.com/fan-bk/p/9440027.html
Copyright © 2011-2022 走看看