jqueryfancybox-3

Closing Fancybox 3 on a mobile device


Using fancybox on desktop, it closes when clicked outside the content. Using it on a mobile device, it closes ONLY when the content is slided up or down (it doesn't react to clicking outside the content).

Is it possible (and how) to close fancybox on a mobile device just by clicking outside the content ?


Solution

  • fancyBox has different "click event" for mobile devices and you can customize them using "mobile" option, for example:

    mobile : {
        clickContent : "close",
        clickSlide : "close"
    }