TA的每日心情 | 衰 2016-12-28 15:19 |
---|
签到天数: 3 天 [LV.2]偶尔看看I
新手上路
- 积分
- 41
|
<!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 rel="stylesheet" href="../dist/css/swiper.min.css">
<!-- Demo styles -->
<style>
html, body {
position: relative;
height: 100%;
}
body {
background: #eee;
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 14px;
color:#000;
margin: 0;
padding: 0;
}
.bxb-second-navbar-person{
background-color:#fff;
width:100%;
height:128px;
overflow-x:hidden;
overflow-y:hidden;
display:none;
}
.swiper-container {
width: 1000px;
height: 128px;
margin-left: auto;
margin-right: auto;
}
.swiper-slide {
text-align: center;
font-size: 18px;
background: #fff;
/* Center slide text vertically */
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
</style>
</head>
<body>
<a>bug</a>
<!-- Swiper -->
<div class="bxb-second-navbar-person" id="user_select_modal">
<div class="container person-container">
<div class="row" style="margin-left:10px;">
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">Slide 1</div>
<div class="swiper-slide">Slide 2</div>
<div class="swiper-slide">Slide 3</div>
<div class="swiper-slide">Slide 4</div>
<div class="swiper-slide">Slide 5</div>
<div class="swiper-slide">Slide 6</div>
<div class="swiper-slide">Slide 7</div>
<div class="swiper-slide">Slide 8</div>
<div class="swiper-slide">Slide 9</div>
<div class="swiper-slide">Slide 10</div>
</div>
<!-- Add Pagination -->
<div class="swiper-pagination"></div>
<!-- Add Arrows -->
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
</div>
</div>
</div>
</div>
<!-- Swiper JS -->
<script src="../dist/js/swiper.min.js"></script>
<!-- Initialize Swiper -->
<script>
function test(){
var test=document.getElementById("user_select_modal");
test.style="display:block";
}
var swiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination',
slidesPerView: 5,
paginationClickable: true,
spaceBetween: 0,
keyboardControl: true,
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev',
});
</script>
</body>
</html>
如上代码样式bxb-second-navbar-person设置为了disply:none;然后我点击“bug”超链接,将bxb-second-navbar-person设置为了disply:block;发现swiper 插件中模块无法滑动,求大神帮解决!!!
|
|