FancyBox从iframe中关闭,并将父页面转到链接 [英] FancyBox close from within iframe and take parent page to the link

查看:87
本文介绍了FancyBox从iframe中关闭,并将父页面转到链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现将以下功能应用于链接onclose可以从iFrame中关闭Fancybox: parent.$.fancybox.close();

I found applying the following function to a links onclose works to close Fancybox from within an iFrame: parent.$.fancybox.close();

我想更进一步,让链接将父页面带到新的URL. 我已经尝试了以下方法,但是没有用:

I want to take this further and have the link take the parent page to a new url. I've tried the following but it doesn't work:

<a onclick="location.href='http://www.domain.com/page/';parent.$.fancybox.close();"> Close and go to page</a>

使用a href

也不起作用,因为onclose优先.

推荐答案

非常简单的解决方案……简直不敢相信我没有想到!!!

Very simple solution... can't believe I didn't think of this!!!

<a href="http://www.domain.com/page/" target="_parent"> Close and go to page</a>

有时候,我发誓我会尝试使事情变得比实际更困难!

Sometime, I swear I try to make things more difficult than they actually are!

这篇关于FancyBox从iframe中关闭,并将父页面转到链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆