Swiper slider space between not showing on load

偶尔善良 提交于 2019-12-11 05:01:48

问题


When I initialize the slider in angular2 the slider not loads sometimes and after resizing it works fine

setTimeout(function() {
    let slider = new Swiper('#property-slider', {
        'nextButton' : '.swiper-button-next',
        'prevButton' : '.swiper-button-prev',
        'slidesPerView' : 4,
        'spaceBetween' : 20,
        'loop' : true,
        'preventClicks': false,
        'breakpoints' : {
            819: {
                slidesPerView: 2
            },
            509: {
                slidesPerView: 1
            }
        }
   });
}, 500)

can someone please give me some solution for it why this is happening

来源:https://stackoverflow.com/questions/44668234/swiper-slider-space-between-not-showing-on-load

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!