fancybox icon indicating copy to clipboard operation
fancybox copied to clipboard

Prevent fancybox from opening

Open rasfront opened this issue 3 years ago • 3 comments

How to prevent fancybox from opening? What can I do? I tried to return false in beforeShow, but it doesn't have any effect, and fancybox opening as if nothing happened. What can I do to prevent fancybox from opening? @mikestreety @krike @PiDelport @fancyapps @supermueller

rasfront avatar Feb 15 '21 09:02 rasfront

Hi,

Why don't you just do the opposite way - initialize fancybox if needed. You could also create your own click handler and then start fancybox manually if needed.

fancyapps avatar Feb 16 '21 16:02 fancyapps

Hi,

Why don't you just do the opposite way - initialize fancybox if needed. You could also create your own click handler and then start fancybox manually if needed.

But it's not a solution. Sometimes I need to prevent fancybox from opening.

Charon89 avatar Dec 15 '21 02:12 Charon89

@Charon89 you did not mention where you want to prevent fancybox from opening - within some callback or not. You can always create you own click handler where you use event.preventDefault(); so that Fancybox will not catch click event and will not start.

fancyapps avatar Dec 15 '21 06:12 fancyapps