I\'m trying to close FancyBox from within the iframe, but parent.$
is always undefined
.
This is my iframe JavaScript:
None of the suggestions worked for me. I had to work around it using the following code. The latest version may be supporting the parent.jQuery.fancybox.close(); approach, but the older versions do not work with that.
For existing sites with older versions of the plugins/Jquery, try this
function close_window()
{
$("#fancy_outer",window.parent.document).hide();
$("#fancy_overlay",window.parent.document).hide();
//window.top.window.$.fancybox.close(); this also does not work :(
}
you could declare and use the function close_window within the Iframe content.