Swiper slider empty spaces

对着背影说爱祢 提交于 2020-04-13 17:09:06

问题


I have some problem with Swiper slider. When i scroll to the end of slider, some empty spaces is visible.

http://take.ms/siqXj

swiper = new Swiper(profile_images, {
    slidesPerView: 4,
    nextButton: '.swiper-button-next',
    prevButton: '.swiper-button-prev',
    observer: true
});

https://jsfiddle.net/x2zu5ett/1/

UPDATE Solution: set 'slidesPerView' attribute to 'auto'


回答1:


Do you still need help?
Try to add this: loopFillGroupWithBlank: false,

Check mine:

var swiper2 = new Swiper('.swiper-container2', {
    slidesPerView: 'auto',
    centeredSlides: true,
    spaceBetween: 150,
    speed: 1500,
    loop: true,
    simulateTouch : true,
    loopFillGroupWithBlank: false,
    grabCursor: true,
    //touchStartPreventDefault: false,
});


来源:https://stackoverflow.com/questions/32650297/swiper-slider-empty-spaces

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