fancybox
fancybox copied to clipboard
Prevent fancybox from opening
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
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.
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 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.