Fancybox closing when click anywhere outside of the modal instead of requiring Esc or clicking on X

4,137 views
Skip to first unread message

Chaya Cooper

unread,
Aug 26, 2012, 12:47:26 AM8/26/12
to fanc...@googlegroups.com
Fancybox seems to be acting like a lightbox, and closing when the user clicks anywhere outside of the modal, instead of requiring them to press 'Esc' or click on 'X' the way a Modal does. How can I change this?

JFK

unread,
Aug 27, 2012, 3:03:36 AM8/27/12
to fanc...@googlegroups.com
if you are using fancybox 1.3.4 then set the API option
 " hideOnOverlayClick ":  false 
if you are using fancybox 2.x then set the API option
helpers   : { 
   overlay
: {closeClick: false}
 
}

bear in mind that fancybox will also close when clicking INSIDE the content IF the option (see below) is set to TRUE
v1.3.4 
"hideOnContentClick" : TRUE
v2.x 
closeClick: TRUE

Chaya Cooper

unread,
Sep 5, 2012, 9:44:58 PM9/5/12
to fanc...@googlegroups.com
Thank you!

I knew it had to be something simple ;-)

Deepa Aravind

unread,
Feb 2, 2014, 7:45:45 PM2/2/14
to fanc...@googlegroups.com
Hi I have a similar problem with fancybox iframe
I use jquery.fancybox.pack.js?v=2.1.2
I am trying to make it a modal, by setting modal: true. But the fancy box closes when the user clicks anywhere outside.

I tried using, closeClick: false and 
helpers   : { 
   overlay
: {closeClick: false}
 
}

Still it doesn't work for me.

Any Suggestions?

Thanks.

JFK

unread,
Feb 2, 2014, 9:17:36 PM2/2/14
to fanc...@googlegroups.com
if you set modal:true, there is no way you can close fancybox clicking anywhere outside the box
See http://jsfiddle.net/Wf2g2/
You must be doing something different or a js error is triggered when you open fancybox so the modal option isn't working
got a link?
Reply all
Reply to author
Forward
0 new messages