I am using fancybox 1.2.6 I want to avoid closing of fancybox when you click on the outside of the content.. 开发者_如何学编程But nothing is working.. can you help me with this.. and one more thing.. i am trying to trigger the fancybox close function when you submit a form..How can i do that ?
set hideOnOverlayClick to false in your options when creating  your fancyBox. Here's an example:
$("a.zoom1").fancybox({
    'hideOnOverlayClick'    :       0  
});
To close it on the submit of your form, bind an onsubmit event to that form, and in that onsubmit function use:
$.fn.fancybox.close();
to cause the fancybox to close.
To prevent the fancybox closing you can try adding these values:
$("a.zoom1").fancybox({
'hideOnOverlayClick': false,
'hideOnContentClick': false
                });
I don't know what language you want to use to close the fancybox, but to close the it from ASP.Net - add an attribute to the form submit button:
btnPostcode.Attributes.Add("onclick", "javascript:parent.$.fancybox.close();");
OPTS IS UNDEFINED
Today I had the task to find out why fancybox is not working on some old site, after debugging for some time, I found that lines of code that initialized the fancybox were commented.
 $("a.calendar_item_edit").fancybox({
        'hideOnContentClick': false,
        'frameWidth': 215,
        'frameHeight': 300
        });
Stripped down the comments, and all was working great. This is fancy box 1.2.0.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论