I want to keep Fancybox open when someone clicks outside of the content popup on the div with the id of "fancybox-overlay". In other words, I want nothing to happen when the user clicks outside the bounds of the popup. Any suggestions?
Asked
Active
Viewed 4,670 times
2 Answers
2
If anyone wants to do this in the new fancybox it's slightly more complex, and more versatile.
Here you can see I set the close button to false so that it doesn't show up, then I set the overlay to not close on click and reset the pointer style.
$('.fancyLinks').fancybox({
closeBtn:false,
helpers : {
overlay : {
closeClick : false,
css : {
'cursor':'default'
}
}
}
});

sidonaldson
- 24,431
- 10
- 56
- 61
-
1or you could just set it to "modal:true" and take care of both – JM4 Aug 16 '13 at 16:22
2
Should be just available in the API: http://fancybox.net/api
I see a few different hiding options, such as "hideOnOverlayClick". Pass the relevant options into the fancybox function as a map, and it should work as you want.
$('.fancyLinks').fancybox({
'hideOnOverlayClick': false
});
Where .fancyLinks
is just some selector I made up, put whatever your target selector is.
for the newer version of Fancy box. try this Fancybox v2 No Hide on Overlay Click - How?

Community
- 1
- 1

Greg Pettit
- 10,749
- 5
- 53
- 72