如何在Swiper Slider上禁用或启用导航或分页响应设备?

时间:2019-03-11 04:39:14

标签: jquery responsive swiper

我想在少于992px的设备上禁用导航并启用分页。另外,我想在992px以上的设备上启用导航并禁用分页。

示例:

var swiper = new Swiper('.testimonial-content', {
        loop: true,
        slidesPerView: 3,
        spaceBetween: 30,
        navigation: {
            nextEl: '.swiper-next',
            prevEl: '.swiper-prev',

        },
        pagination: {
            el: '.swiper-pagination',
            type: 'bullets',
            clickable: true,
            hide: true
        },
        breakpoints: {
            // when window width is <= 575px
            575: {
                slidesPerView: 1,
                spaceBetween: 0,
                **I want to disable navigation on this device.**
            },
            // when window width is <= 991px
            991: {
                slidesPerView: 2,
                spaceBetween: 20
            }
        }
    });

0 个答案:

没有答案