fancyapps / fancybox

jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable.
http://fancyapps.com/
7.29k stars 1.79k forks source link

Disabling swipe/drag in Fancybox 4 #2630

Closed nofx77 closed 2 years ago

nofx77 commented 2 years ago

Hi guys, im trying desperately to disable the swipe/drag when I open an inline-content.

This my html :

<a href="#" data-fancybox="dialog" data-src="#modal-hightlights" class="button primary hollow small">Edit</a>

I try : data-options='{"touch" : false}' dont work

Fancybox.bind("[data-fancybox]", {
    touch: false,
    on: {
        reveal: (fancybox, slide) => {
            modalAfterShow(slide.src, slide.$trigger);
        },
    },
});

dont work

What I missing?

Thank you!

fancyapps commented 2 years ago

Hi,

If you wish to disable "vertical drag to close" feature, then set dragToClose: false. If you wish to disable all touch events, then set:

 Fancybox.bind('[data-fancybox]', {
    Carousel: {
      Panzoom: {
        touch: false,
      },
    },
  });