views:

331

answers:

1

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 ?

+1  A: 

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.

Erik
Hello Eriki tried to close the fancybox as you said.. but i am getting some error msg "opts is undefined" and it doesn't close also...can you figure it out what it could be /
AquaGirl
I can't figure it out based on that error; I've never closed FB with a link of my own before - I lifted that from the fb website.
Erik