简体   繁体   English

从iframe关闭fancybox

[英]Close fancybox from iframe

I have a Fancybox that opens a contact form from an iframe. 我有一个Fancybox,可从iframe打开联系表单。 Inside the iframe, i have a close button but it's not working. 在iframe中,我有一个关闭按钮,但是它不起作用。

I have tryed both with $.fancybox.close(); 我已经尝试过$.fancybox.close(); and parent.jQuery.fancybox.close(); parent.jQuery.fancybox.close();

Here's my page with the problem: http://www.no-gods-no-masters.com (click on the contact button) 这是我遇到问题的页面: http : //www.no-gods-no-masters.com (单击联系按钮)

What am I doing wrong ? 我究竟做错了什么 ?

按照http://fancybox.net/api尝试以下操作:

parent.$.fancybox.close();

The problem is you are trying to execute parent windows js function with different host name ( its not allowed ). 问题是您正在尝试使用不同的主机名(不允许使用)执行父Windows js函数。 Try access you site without www. 尝试访问没有www.网站www. ( this is because your contact button using fancy from url without www. ) (这是因为您的contact按钮使用的是网址中没有www.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM