Ferie
Ferie

Reputation: 1436

Is it possible to disable the swipe functionality when the image is zoomed?

I am using angular2-useful-swiper wrapper for iDangerous Swiper for a project and I need to disable the swiping functionality when the image is zoomed.

In Swiper Api there is nothing about this, so the question: is it possible?

Upvotes: 1

Views: 1024

Answers (1)

michael_v92
michael_v92

Reputation: 21

as a work-around, you could subscribe to swiper's 'zoomChange' event and based on the scale (one of 3 args of it) update the mySwiper.allowTouchMove to false. that worked for me in the Vue app.

my use-case

yourCallbackToEvent(scale) {
  yourSwiper.allowTouchMove = scale === 1;
};

Upvotes: 1

Related Questions