swiper2兼容ie8浏览器问题

目前swiper2的版本才兼容ie8

1.分页按钮问题:
<div class="swiper-container" style="height: 545px">
 <div class="swiper-wrapper">
    <div class="swiper-slide">
      <img src="img/banner1.png" class="headPic" />
    </div>
    <div class="swiper-slide">
      <img src="img/banner2.png" class="headPic" />
    </div>
    <div class="swiper-slide">
      <img src="img/banner3.png" class="headPic" />
    </div>
  </div>
</div>
<div class="pagination"></div>

其中分页按钮要自己定义,与swiper-container同级

2.上下页按钮:

js:

var mySwiper = new Swiper(".swiper-container1", {
  slidesPerView: 2,//一个slide显示两个图片
  slidesPerGroup: 2,//一共两组
  onInit: function(swiper) {
    swiper.swipeNext();
  }
});
$("#btn1").click(function() {
  mySwiper.swipePrev();//上一页
});
$("#btn2").click(function() {
  mySwiper.swipeNext();//下一页
});

html:

<div class="swiper1">
<div class="swiper-container1">
  <div class="swiper-wrapper">
    <div class="swiper-slide">
      <img src="img/jiudian.png" class="headPic" />
    </div>
    <div class="swiper-slide">
      <img src="img/jiudian1.png" class="headPic" />
    </div>
    <div class="swiper-slide">
      <img src="img/jiudian2.png" class="headPic" />
    </div>
    <div class="swiper-slide">
      <img src="img/jiudian3.png" class="headPic" />
    </div>
  </div>
</div>
<div id="btn1" class="btn"><img src="img/left1.png" /></div>
<div id="btn2" class="btn"><img src="img/right1.png" /></div>
</div>

上下页的btn按钮也要自己定义

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值