views:

55

answers:

1

I am trying to prevent fancybox window from closing when the user clicks outside of the fancybox window. I am using fancybox Version: 1.3.1 on IE7, I have tried the following but I have yet to succeed. Any help is very much appreciated.

http://stackoverflow.com/questions/2115234/on-fancybox-1-2-6-close

http://stackoverflow.com/questions/1363806/jquery-fancybox-prevent-close-on-click-outside-of-fancybox

My Code:

<script type="text/javascript">
 $(document).ready(function() {         
 $("a.fancybox").fancybox({
  'width'           : '68%',
  'height'          : '80%',
  'autoScale'           : true,
  'transitionIn'        : 'none',
  'transitionOut'       : 'none',
  'type'            : 'iframe'
 });            
});
</script>

Thanks

+1  A: 

Try adding this option :

'hideOnOverlayClick' : false

cf API doc : http://fancybox.net/api

Golmote
Thank you, that worked. I could've sworn I had tried that before.
Noe
I just realized why it wasn't working before, had this 'false' instead of just false no quotes.
Noe
In effect, `'false'` with quotes is a string that evaluates to `true` in a boolean context ! ^^
Golmote