0

How can I disable the dragging of a Fancybox 4 window in mobile? When browsing from the desktop, dragging is disabled by default; from mobile it seems to be active by default.

My snippet:

Fancybox.show(
      [
        {
          src: 'page.html',
          type: 'ajax'
        }
      ]
    );

In previous versions I used this snippet:

helpers: {
   overlay: {
     locked: true
     }
   }

EDIT

Problem solved, thank you very much.

  • First, Fancybox 4 does not use jQuery. Secondly, I do not understand what do you mean by "dragging of a window". – Janis Dec 01 '22 at 18:28
  • By dragging the window, I mean that once the window is open in Fancybox, I can move it by dragging it with the mouse: above, below, right, left. I, on the other hand, want to fix it in the centre of the screen without any possibility of moving it. I can record an example video. –  Dec 01 '22 at 20:39
  • In this request, the video shows exactly what I mean: https://stackoverflow.com/questions/59529931/how-to-disable-only-drag-up-to-close-the-fancybox-lightbox . But I use Fancybox 4. –  Dec 01 '22 at 21:20
  • Have you tried setting `dragToClose: false`? – Janis Dec 02 '22 at 10:14
  • Perfect. It works, thank you! I hadn't tested `dragToClose` yet because I thought it would only prevent closing from movement but not the movement itself. –  Dec 02 '22 at 11:15
  • Please do not edit in "solved" - better post an answer and mark it as "accepted". – janw Dec 02 '22 at 11:27

0 Answers0