fancyboxfancybox-3

Fancybox - Disable close on outside click


I'm trying to prevent close of fancybox when someone click outside of fancybox-content area.

HTML:

<div id="banner-message" style="display: none">
  <p>Hello World</p>
</div>

JS:

jQuery.fancybox.open(jQuery('#banner-message'), {
    clickOutside: false
});

DEMO: https://jsfiddle.net/xjw4b5jq/


Solution

  • You have to use clickSlide option instead.

    fancybox3 works as a slider and you can reposition/resize slider area, therefore there are two similar, but different options.