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

swiper

时间:2016-12-30 20:36:35      阅读:270      评论:0      收藏:0      [点我收藏+]

标签:set   pad   nim   ebe   mode   dem   idt   word   eve   

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Swiper demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<!-- Link Swiper‘s CSS -->
<link href="http://cdn.bootcss.com/Swiper/3.4.1/css/swiper.css" rel="stylesheet">

<!-- Demo styles -->
<style>
body {
background: #eee;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
color:#000;
margin: 0;
padding: 0;
}
.swiper-container {
width: 100%;
height: 300px;
margin: 20px auto;
}
.swiper-slide {
text-align: center;
font-size: 18px;
background: #fff;
}
</style>
</head>
<body>
<!-- Swiper -->
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">Slide 1</div>
</div>
</div>
<div id="bless">
<input id="bless-word" type="text">
<a id="share-button">立即分享</a>
</div>

<!-- Swiper JS -->
<script src="http://cdn.bootcss.com/Swiper/3.4.1/js/swiper.min.js"></script>
<script type="text/javascript" src="../js/jquery-1.9.0.min.js"></script>
<script>
var swiper = new Swiper(‘.swiper-container‘, {
slidesPerView: 3,
paginationClickable: true,
spaceBetween: 30,
freeMode: true
});
var shareBtn = document.getElementById("share-button");
var bless = document.getElementById("bless-word");

shareBtn.addEventListener("click",function(){
var blessWord = bless.value;
var url = "index2.html?word=" + blessWord;
shareBtn.setAttribute("href",url);
},false);
</script>
</body>
</html>

swiper

标签:set   pad   nim   ebe   mode   dem   idt   word   eve   

原文地址:http://www.cnblogs.com/dream0530/p/6238032.html

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