开发者

how to get out of the fancybox iframe?

I have to do some form submission and then get out of the fancybox which holds an iframe. How to do that? I tried using $.fn.fancybox开发者_JS百科.close(); but it cause some error.


Remember the Same origin policy

If your iframe is from another domain you can't have js communication with your site


I use this script to close a Fancybox iframe after submission:

parent.$.fn.fancybox.close();


use this simply

$.fancybox.close();


If your iframe is on the same domain try using parent.fancybox_instance.close() inside the iframe

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜