首页 > 代码库 > swiper
swiper
<!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="http://www.mamicode.com/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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。