成都创新互联网站制作重庆分公司

swiper手动滑动后失效解决

     var mySwiper = new Swiper('.swiper-container', {
        autoplay: {
            disableOnInteraction: false,
            delay: 2500,
        },
        preventLinksPropagation: false,   // 阻止点击事件冒泡
        speed: 500,
        loop: true,
        // 如果需要分页器
        pagination: {
            el: '.swiper-pagination',
        },
            // 如果需要前进后退按钮
        navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
        },
        onSlideChangeEnd: function (swiper) { // pagination BUG
            var activeIndex = swiper.activeIndex;
            $('.swiper-pagination')
                .find('span')
                .eq(activeIndex)
                .addClass('swiper-pagination-bullet-active')
                .siblings()
                .removeClass('swiper-pagination-bullet-active');
        }
    });
    // 鼠标移入停止自动滚动
    $('.swiper-slide').mouseenter(function() {
        mySwiper.autoplay.stop();
    })
    // 鼠标移出开始自动滚动
    $('.swiper-slide').mouseleave(function() {
        mySwiper.autoplay.start();
    })

网页标题:swiper手动滑动后失效解决
本文来源:http://cxhlcq.cn/article/pisdje.html

其他资讯

在线咨询

微信咨询

电话咨询

028-86922220(工作日)

18980820575(7×24)

提交需求

返回顶部