O
O
ololodf2021-07-13 07:45:21
css
ololodf, 2021-07-13 07:45:21

Why is the slide width not even in the swiper slider?

60ed19ee1f880783984399.png

Installed swiper carousel .
Plugged in the following code:

$( document ).ready(function() {
    var swiper = new Swiper('#slider', {
      slidesPerView: 1,
      autoHeight: true,
      spaceBetween: 0,
      navigation: {
        nextEl: ".swiper-button-next",
        prevEl: ".swiper-button-prev"
      },
      autoplay: {
        delay: 333333500,
        disableOnInteraction: false,
      },
      speed: 900
    });
  });


.swiper-container {
    width: 100%;
    height: 100%;
  }
  .swiper-slide {
    display: -webkit-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    -webkit-align-items: center;
    align-items: center;
  }


As you can see in the picture, the strip (piece) of the next slide creeps out onto the active slide, why is that? Has anyone experienced this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WebPanda, 2021-07-14
@WebPanda

There was such a problem, I solved the problem by setting the indents between the slides (spaceBetween).
Setting the width of .swiper-slide in css can also help .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question