• 轮播图之缩略图API


    <!DOCTYPE html>
    <html>
    	<head>
    		<meta charset="utf-8">
    		<title></title>
    		<link rel="stylesheet" href="swiper.min.css">
    		<script src="swiper.min.js"></script>
    		<style>
        html, body {
          position: relative;
          height: 100%;
        }
        body {
          background: #000;
          font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
          font-size: 14px;
          color:#000;
          margin: 0;
          padding: 0;
        }
        .swiper-container {
           100%;
          height: 300px;
          margin-left: auto;
          margin-right: auto;
        }
        .swiper-slide {
          background-size: cover;
          background-position: center;
        }
        .gallery-top {
          height: 100%;
           100%;
        }
        .gallery-thumbs {
          height: 5%;
          padding: 10px 0;
    	  color:#fff;
    	  font-size:24px;
    	  position:fixed;
    	  top:0;
        }
        .gallery-thumbs .swiper-slide {
           25%;
          height: 100%;
          
        }
        .gallery-thumbs .swiper-slide-thumb-active {
          color:red;
        }
    
      </style>
    
    	</head>
    	<body>
    		  <div class="swiper-container gallery-top">
    			<div class="swiper-wrapper">
    			  <div class="swiper-slide" style="background-image:url(img/1.jpg)"></div>
    			  <div class="swiper-slide" style="background-image:url(img/2.jpg)"></div>
    			  <div class="swiper-slide" style="background-image:url(img/3.jpg)"></div>
    			  <div class="swiper-slide" style="background-image:url(img/4.jpg)"></div>
    			</div>
    		  </div>
    		  <div class="swiper-container gallery-thumbs">
    			<div class="swiper-wrapper">
    			  <div class="swiper-slide">图一</div>
    			  <div class="swiper-slide">图二</div>
    			  <div class="swiper-slide">图三</div>
    			  <div class="swiper-slide">图四</div>
    			</div>
    		  </div>
    
    		<script language="javascript"> 
    		var galleryThumbs = new Swiper('.gallery-thumbs', {
    		  spaceBetween: 10,
    		  slidesPerView: 4,
    		  freeMode: true,
    		  watchSlidesVisibility: true,
    		  watchSlidesProgress: true,
    		});
    		var galleryTop = new Swiper('.gallery-top', {
    		  spaceBetween: 10,
    		  thumbs: {
    			swiper: galleryThumbs
    		  }
    		})
    
    		</script>
    	</body>
    </html>
    
    
  • 相关阅读:
    noi.ac 集合
    NOI2019 SX 模拟赛 no.5
    带花树草解
    UR#13 SRAND
    【51nod1847】 奇怪的数学题
    ●POJ 3237 Tree
    ●BZOJ 2049 [Sdoi2008]Cave洞穴勘测
    ●BZOJ 2002 [Hnoi2010]Bounce 弹飞绵羊
    ●POJ 2983 Is the Information Reliable?
    ●POJ 3378 Crazy Thairs
  • 原文地址:https://www.cnblogs.com/lxystar/p/10855841.html
Copyright © 2020-2023  润新知