0

我正在使用这个滑块:https ://swiperjs.com/api/

现在,我想在设备宽度等于或小于 515 时启动滑块。为此,我正在使用此 JS 代码,但当设备大于 515 时它不会停止滑块。它应该在设备宽度小于等于515:

var mySwiper = new Swiper('.swiper-container', {
    direction: 'horizontal',
    slidesPerView: 1,
    loop: true,
    pagination: {
        el: '.swiper-pagination',
        clickable: true,
    },
    autoplay: {
        delay: 3000,
    },
    breakpoints: {
        // when window width is >= 320px
        515: {
            slidesPerView: 1,
            spaceBetween: 20
        },
    }
});
4

1 回答 1

0

小于或等于,如果我是正确的,我认为你做 <= 或 <==

idk自从我使用java脚本以来已经有一段时间了

于 2020-11-24T05:31:33.583 回答