I want to set up buttons types that can close the window, so I made wrote this code:
$(".fstandard").fancybox({
afterClose: function() {
alert("Closed!");
},
afterShow : function() {
$(':button').click(function() {
$.fancybox.close();
})
}
});
I tried in vain several other codes, but none of them worked, the window does not close. This line gives me an error:
$.fancybox.close();
$.fancybox is undefined
I use FancyBox v2.0.3. In their documentation, it is well presented to close the window: http://fancyapps.com/fancybox/#support
Thanks in advance
It says in the documentation:
To use from inside the iframe -
<a href="javascript:parent.$.fancybox.close();">Close me</a>
Have you tried:
$(':button').click(function() {
parent.$.fancybox.close();
})
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