How to disable swiping fancybox slides by mousemove
Asked Answered
T

3

9

I'm using fancybox 3. I need to turn off swiping fancybox slides by mousemove. I would like to leave only control buttons next\prev. How can I do that? Thanks.

Tortoni answered 7/8, 2017 at 18:2 Comment(0)
A
9

Simply set touch:false to disable touch events.

Ala answered 7/8, 2017 at 18:38 Comment(0)
T
13

So, the full answer will be:

Using data-options attribute

<a data-options='{"touch" : false}' data-fancybox data-src="#myElement" href="javascript:;">Click me</a>

Or when initializing fancybox

$('selector').fancybox({
    touch: false
});

From @Janis answer here: https://github.com/fancyapps/fancybox/issues/1277

Tortoni answered 9/8, 2017 at 18:43 Comment(1)
btw, a quick shortcut data-touch='false' works, tooAla
A
9

Simply set touch:false to disable touch events.

Ala answered 7/8, 2017 at 18:38 Comment(0)
N
5

The previous answer did not work for me on Fancybox 3.5.*. I had to move the touch option to inside the opts object, like as follows:

$.fancybox.open({
    src: yoursource,
    opts: {
        touch: false
    }
});
Nicolenicolea answered 1/5, 2020 at 14:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.