码迷,mamicode.com
首页 > 其他好文 > 详细

Swiper 简单实用

时间:2015-09-18 12:11:55      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:web   js   html5   swiper   

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Swiper demo</title>
    <link rel="stylesheet" href="css/swiper.min.css"/>
    
    <script src="jslib/swiper.js"></script>

    <script>
	    window.onload = function() {
	    		var swiper = new Swiper(‘.swiper-container‘, {
		        pagination: ‘.swiper-pagination‘,
		        paginationClickable: true,
			    nextButton: ‘.swiper-button-next‘,
			    prevButton: ‘.swiper-button-prev‘,
			    loop:true
		    });
		};
    </script>

    <style>
	    .swiper-container {
	        width: 500px;
	        height: 500px;
	    }

	    .swiper-slide img{
	    	height:100%;
	    	width:100%
	    }
    </style>
</head>
<body>
    <div class="swiper-container">
        <div class="swiper-wrapper">
            <div class="swiper-slide">
            	<img src="images/1.jpg" />
            </div>
            <div class="swiper-slide">
            	<img src="images/2.jpg" />
            </div>
            <div class="swiper-slide">
            	<img src="images/3.jpg" />
            </div>
        </div>
        <!-- 分页按钮 -->
        <div class="swiper-pagination"></div>

        <!-- 导航按钮 -->
	    <div class="swiper-button-prev"></div>
	    <div class="swiper-button-next"></div>
    </div>
</body>
</html>


Swiper 简单实用

标签:web   js   html5   swiper   

原文地址:http://antlove.blog.51cto.com/10057557/1695920

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!