-1

I'm currently using Fancybox I'd like to disable image zoom with the pinch gesture on iPad.

I've tried using CSS touch-action:none; and setting options in fancy box.

$("[data-fancybox]").fancybox({
  clickContent    : false,
});

I'd like the image to not respond to pinch zooming.

Adan Rehtla
  • 1,548
  • 2
  • 13
  • 26
Drew
  • 1
  • 1
  • This might be a duplicate of [Fancybox 3: Disable zoom when image is clicked](https://stackoverflow.com/questions/45638608/fancybox-3-disable-zoom-when-image-is-clicked) – Adan Rehtla May 29 '19 at 23:38
  • I tried this - it seemed to address clicks, but not pinch gestures. – Drew May 30 '19 at 00:36
  • I should mention the I tried: $("[data-fancybox]").fancybox({ touch: false }); and data-options='{"touch" : false}' and they did not work for me - I could still pinch and zoom the image – Drew May 30 '19 at 00:56
  • It works, I can guarantee; if it does not work for you, then you have made some mistake, you have to show your page to see where the problem is. – Janis May 30 '19 at 04:36

1 Answers1

0

You can disable gestures by setting touch: false, for example, this would disable for entire page:

$.fancybox.defaults.touch = false;

Or you can disable individually by addingdata-options='{"touch" : false}' to your link.

Janis
  • 8,593
  • 1
  • 21
  • 27