files_mediaviewer icon indicating copy to clipboard operation
files_mediaviewer copied to clipboard

Insert function when touch sliding image on mobile

Open Arykelton opened this issue 5 years ago • 0 comments

I would like to insert a function that will be executed when the user changes slides by sliding his finger on mobile devices. I was able to add the function, but it only worked when the user clicks the "next" or "prev" button, when sliding your finger on mobile devices it is not executed. Part of the code I changed in Viewer.vue:

mounted() { this.$bus.$on("swiper:slideTo", to => { if (to === "next") { this.swiper.slideNext(); this.myfunction();

  } else if (to === "prev") {

    this.swiper.slidePrev();
    this.myfunction();

  } else if (typeof to === "number") {

    this.swiper.slideTo(to);
    this.myfunction();
  }
});

...

Arykelton avatar Jul 01 '20 16:07 Arykelton