Hi all i want to be able to close fancyBox when it is open from within.
I have tried the following but to no avail:
function closeFancyBox(html){ var re = /.*Element insert complete!.*/gi; if( html.search( re ) == 0 ){ $.fancybox.close(); //alert("foo"); } }
foo will open in dialog but will not close down. any hints?
Try this: parent.$.fancybox.close();
See Fancybox API documentation.
According to http://fancybox.net/faq
- How can I close FancyBox from other element? ?
Just call
$.fn.fancybox.close()
on your onClick event
So you should just be able to add in the fn
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With