|
5#
楼主 |
发表于 2015-5-5 18:06:25
|
只看该作者
我的意思就是,图片这个大小比例在手机上显示出来太小了,我想放大点,但是无论我怎么调整swiper-slide的width都无效,为什么会这样?
我把整个页面代码贴下吧
- <!-- HTML5文件 -->
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8"/>
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
- <title show="false"></title>
- <link rel="stylesheet" href="../../script/swiper/swiper.min.css">
- <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: 400px;
- margin: 20px auto;
- background-image: url([img]http://img31.mtime.cn/mt/2015/03/30/132850.81039914_1280X720X2.jpg[/img]);
- }
- .swiper-slide {
- text-align: center;
- font-size: 18px;
- background: transparent;
- background-size: cover;
- background-position: center;
- width: 100%;
- /* 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;
- }
- .swiper-slide:nth-child(2n) {
- width: 40%;
- }
- .swiper-slide:nth-child(3n) {
- width: 20%;
- }
-
- .blur {
- -webkit-filter: blur(15px); /* Chrome, Opera */
- -moz-filter: blur(15px);
- -ms-filter: blur(15px);
- filter: blur(15px);
- }
- </style>
- </head>
- <body>
-
- <!-- Swiper -->
- <div class="swiper-container blur">
- <div class="swiper-wrapper">
- <div class="swiper-slide"><img style="width:100%;height:60%" src="http://img31.mtime.cn/mt/2015/03/30/132850.81039914_1280X720X2.jpg"></img></div>
- <div class="swiper-slide"><img style="width:100%;height:60%" src="http://img31.mtime.cn/mt/2015/03/27/120535.53814152_1280X720X2.jpg"></img></div>
- <div class="swiper-slide"><img style="width:100%;height:60%" src="http://img31.mtime.cn/mt/2015/04/27/160431.68946159_1280X720X2.jpg"></img></div>
- <div class="swiper-slide"><img style="width:100%;height:60%" src="http://img31.mtime.cn/mt/2015/04/13/091349.58563474_1280X720X2.jpg"></img></div>
- <div class="swiper-slide"><img style="width:100%;height:60%" src="http://img31.mtime.cn/mt/2015/04/22/095151.77465299_1280X720X2.jpg"></img></div>
- <div class="swiper-slide"><img style="width:100%;height:60%" src="http://img31.mtime.cn/mt/2015/03/17/095942.88667571_1280X720X2.jpg"></img></div>
- </div>
- <!-- Add Pagination -->
- <div class="swiper-pagination"></div>
- </div>
-
-
- <!-- swiper滑动组件 -->
- <script type="text/javascript" src="../../script/swiper/swiper.min.js"></script>
- <script>
- var swiper = new Swiper('.swiper-container', {
- slidesPerView: 2,
- centeredSlides: true,
- spaceBetween: 25
- });
- </script>
- </body>
- </html>
复制代码 |
|