ksachdeva / angular-swiper

Angular directive for nolimits4web/Swiper
Apache License 2.0
197 stars 94 forks source link

Autoplay stops on interaction #75

Open sarkaramitabh300 opened 6 years ago

sarkaramitabh300 commented 6 years ago

Autoplay stops on interaction and have to refresh page in order to restart autoplay, I have tried to use disableOnInteraction:'false'but it's not working.

sperro commented 6 years ago

Check which version of swiper.js you have installed. I think this was fixed in the latest version. Another work around is to trigger startAutoplay() after a transition like this

HTML

<ks-swiper-container swiper="swiper" on-ready="onReadySwiper(swiper)">
...
</ks-swiper-container>

JS

 $scope.onReadySwiper = function (swiper) {
        swiper.on('onTransitionStart', function () {
           var mySwiper = $('.swiper-container')[0].swiper;
           mySwiper.startAutoplay(); //restart autoplay
        });
    };