javascript – how to make slide transition smoother and not instant on swiper update – Swiper API

html - Animation after toggling doesn't apply the second style

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:

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);

Source link

Leave a reply

Please enter your comment!
Please enter your name here