swiper2个常用用法3D覆盖和左右留白




<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title></title>
	<link rel="stylesheet" href="">
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.4.2/css/swiper.min.css">
	<style>
.swiper-container{
	height: 300px;
	width: 500px;
}
.swiper-slide{
	height: 300px;
	width: 250px;
	border:1px solid #ccc;
}
.red{
	background: red;
}
.green{
	background: green;
}
.blue{
	background: blue;
}
.orange{
	background: orange;
}
.pink{
	background: pink;
}
	</style>
</head>
<body>
 <div class="swiper-container">
    <div class="swiper-wrapper">
        <div class="swiper-slide red"></div>
        <div class="swiper-slide green"></div>
        <div class="swiper-slide blue"></div>
        <div class="swiper-slide orange"></div>
        <div class="swiper-slide pink"></div>
    </div>
    <div class="swiper-pagination"></div>
</div>

 <div class="swiper-container2">
    <div class="swiper-wrapper">
        <div class="swiper-slide red"></div>
        <div class="swiper-slide green"></div>
        <div class="swiper-slide blue"></div>
        <div class="swiper-slide orange"></div>
        <div class="swiper-slide pink"></div>
    </div>
    <div class="swiper-pagination"></div>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.4.2/js/swiper.min.js"></script>	
<script>
	 var swiper = new Swiper('.swiper-container',{
                pagination:'.swiper-pagination',
                loop:true,
                //autoplay:1000,
                //grabCursor:true,
                centeredSlides:true,
                slidesPerView:'auto',
                effect:'coverflow',
                coverflow:{
                    rotate:0,//滑动时旋转角度
                    stretch:100,//聚合宽度
                    depth:100,//景深
                    modifier:1,//覆盖叠加层数
                    slideShadows:false//是否阴影
                }
            });
</script>

<script>
    var swper2 = new Swiper('.swiper-container2', {
    	direction: 'horizontal',
      	spaceBetween : 10,
	    loop: true,
	    slidesPerView : 1.2,
	    centeredSlides : true
    });
  
</script>
</body>
</html>

阅读更多
个人分类: swiper
相关热词: swiper2
下一篇nodejs批量替换js/html文件内容
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭