JS swiper轮播图完美兼容手机端

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>swiper</title>
<link href="dist/css/swiper.min.css" rel="stylesheet">
</head>
<body>
<div style="width:640px; margin:20px auto;">
<div class="swiper-container">
    <div class="swiper-wrapper">
        <div class="swiper-slide"><a href="###"><img src="images/banner01.jpg"></a></div>
        <div class="swiper-slide"><a href="###"><img src="images/banner02.jpg"></a></div>
        <div class="swiper-slide"><a href="###"><img src="images/banner03.jpg"></a></div>
    </div>
    <div class="swiper-pagination"></div>
</div>
</div>

<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="dist/js/swiper.min.js"></script>
<script>	
$(function(){
	var mySwiper = new Swiper('.swiper-container',{
		pagination: '.swiper-pagination',//当前位置的图片点
		speed: 400,
		loop:true,//是够能够循环无缝滑动
		grabCursor: true,
		paginationClickable: true,//允许触摸
		autoplay:1000//一秒切换
	})
});
</script>
</body>
</html>

 

效果图:

 

©️2020 CSDN 皮肤主题: 大白 设计师: CSDN官方博客 返回首页
实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值