如何让iframe的灯箱“突破”? [英] How to make a lightbox 'breakout' of an iframe?
问题描述
我在网站的首页上有一个iframe。 iframe加载.php页面,该页面具有使用jQuery Tools选项卡构建的旋转器。在第一个标签上,我使用jQuery Tools Overlay在灯箱中弹出YouTube视频。
I have an iframe on the front page of a site. The iframe loads a .php page which has a rotator built with jQuery Tools Tabs. On the first tab, I use jQuery Tools Overlay to popup a YouTube video in a lightbox.
这一点在独立页面上工作正常,但是在查看时该网站的首页灯箱仅限于iframe。
This is all working fine on the stand-alone page, however when viewed on the site's front page the lightbox is confined to the iframe.
我需要灯箱弹出/突破iframe并接管整个网站的首页。
I need the lightbox to popup/breakout of the iframe and takeover the entire site's front page.
是有没有办法获取iframe的父窗口或顶部窗口,然后让灯箱在那里打开?
Is there a way to fetch the iframe's parent window or the top window and then make the lightbox open there?
或者是否还有另一种方法可以完成此任务?
Or is there another method all together with which I could accomplish this?
该网站已被锁定以进行开发,但您可以在此处查看独立的php页面:
Stand-Alone Page
The site is locked down for development, but you can view the stand-alone php page here: Stand-Alone Page
推荐答案
任何灯箱偏好?
如果你很灵活,你可以使用 Fancybox(v2.x)并在此演示中实现这种效果: http://picssel.com/playground/jquery/fancyboxFromIframe_16Jan12.html
If you are flexible, you could use Fancybox (v2.x) and achieve that effect like in this demo: http://picssel.com/playground/jquery/fancyboxFromIframe_16Jan12.html
在该页面中是两个iframe:左边的那个显示你当前的场景,而ri上的那个场景找到你想要的解决方案。
In that page there are two iframes: the one on the left shows your current scenario while the one on the right the solution you are looking for.
UPDATE :使用 jQuery.noConflict()
<script type="text/javascript" src="other_lib.js"></script> (mootools)
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$.noConflict();
// Code that uses other library's $ can follow here.
</script>
这篇关于如何让iframe的灯箱“突破”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!