现在有三张echarts的图,通过swiper轮播,使用鼠标滚轮控制,但是只能滚动两张图
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide">
<div class="dbidc-ip-info">
<div class="item-title">
<span>IP分配</span>
<span></span>
</div>
<div id="ip-data-bdidc" style="width: 512px;height:190px;"></div>
</div>
</div>
<div class="swiper-slide">
<div class="dbidc-rack-info">
<div class="item-title">
<span>机架分配</span>
<span></span>
</div>
<div id="rack-data-bdidc" style="width: 512px;height:190px;"></div>
</div>
</div>
<div class="swiper-slide">
<div class="dbidc-user-info">
<div class="item-title">
<span>用户分配</span>
<span></span>
</div>
<div id="user-data-bdidc" style="width: 512px;height:190px;"></div>
</div>
</div>
</div>
<!-- Add Arrows -->
<div class="swiper-button-next"></div>
<div class="swiper-button-prev"></div>
<!-- Add Pagination -->
<div class="swiper-pagination"></div>
</div>
$(function () {
var swiper = new Swiper('.swiper-container', {
//pagination: {
// el: '.swiper-pagination',
// dynamicBullets: true,
//},
mousewheel: true,
observer:true,//修改swiper自己或子元素时,自动初始化swiper
observeParents:true//修改swiper的父元素时,自动初始化swiper
});
});
你是Swiper5 版本吧,回退到swiper4.4.2 版本就行了,应该是新版本迁移有个状态没有清理