swiper插件,如何解决鼠标滚轮控制不完整显示?

现在有三张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
        });
    });
阅读 3.1k
1 个回答

你是Swiper5 版本吧,回退到swiper4.4.2 版本就行了,应该是新版本迁移有个状态没有清理

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题