我有一个iframe页面,在iframe页面我有一个img打开fancybox。这工作得很好,只是模式框的目标是iframe,只给整个页面的一部分一个黑色覆盖层,并将fancybox置于iframe而不是整个页面上。突破iframe与fancybox
这是代码:
<img src="/img/icons/calendar.png" class="fancybox" id="fancyCalendar" />
<script>
$j('#fancyCalendar').click(function() {
$j.fancybox.open({
href: 'calendar.html',
type: 'iframe',
padding: 5,
width: 880,
height: 335
});
});
</script>
我已经试过这些东西,没有工作:
- 添加目标到IMG
- 使得在IMG的链接与目标
- prepanding window.parent to fancybox.open prepending
- window.parent.parent to fancybox.open
我不知道还有什么我可以试试,有没有人知道如何做到这一点?
[Extend Fancybox inside a iFrame to outside](http://stackoverflow.com/questions/6528177/extend-fancybox-inside-an-iframe-to-outside) –
可能重复[调用Fancybox in父母从iframe](http://stackoverflow.com/questions/8853727/call-fancybox-in-parent-from-iframe) – JFK
如何使用fancybox v2.x http://stackoverflow.com/a/8855410/1055987包括演示 – JFK