Skip to content Skip to sidebar Skip to footer

Fancybox 3: Disable Zoom When Image Is Clicked

I have set up a simple image slider using the Fancybox 3 plugin (http://fancyapps.com/fancybox/3/docs/) within the Kirby CMS (https://getkirby.com/). The only thing I'm not able to

Solution 1:

Just use clickContent option:

$("[data-fancybox]").fancybox({
  thumbs          : false,
  hash            : false,
  loop            : true,
  keyboard        : true,
  toolbar         : false,
  animationEffect : false,
  arrows          : true,
  clickContent    : false
});

Demo - https://codepen.io/anon/pen/XaabLJ?editors=1010

clickSlide option is used for clicks outside content, but inside the slide. And since parent of the slide can be resized (like in this example - https://codepen.io/fancyapps/pen/ZKqaKO), clickOutside option is when clicked outside the slide.


Solution 2:

To disable click to scroll and remove zoom button from the toolbar:

$('[data-fancybox]').fancybox({
  clickContent: 'close',
  buttons: ['close']
})

Post a Comment for "Fancybox 3: Disable Zoom When Image Is Clicked"