0
votes

I'm using Swiper API to create a mobile-friendly slider but I need to find a way to make the swiper.update() method reposition the slides smoothly and not instantly placing them upon removing a slide.

Right now when removing a slide and calling swiper.update to reposition the remaining slides, it just reposition the remaining slides instantly. How can I make it run the same way but with a smoother reposition of the slides?

Link for Swiper API: https://swiperjs.com/swiper-api

Initialization of Swiper

swiper = new Swiper(".mySwiper", {
    slidesPerView: 3,
    allowTouchMove: true,
    allowSlideNext: true,
    allowSlidePrev: true,
    spaceBetween: 5,
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
    },
    pagination: {
        el: ".swiper-pagination",
        clickable: true,
    },
});

swiper.setTransition(this, 0.3);

post some runnable codeAmir Rahman
Can you please include a Minimal, Reproducible Example? You're talking about removing and update the slider but nothing like that happens in your code snippet. Furthermore we don't know what HTML is used nor styling is applied.Reyno
I think the time of the transition is given in milliseconds. Did you mean to give the time as 0.3 seconds? If so try 300 instead of 0.3A Haworth