最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - open iframe fancybox from within an iframe so that it opens in the parent - Stack Overflow

programmeradmin0浏览0评论

I can get this to work which opens a fancybox IMAGE from within an iframe

<a href="javascript:parent.$.fancybox.open({href : 'myurl'});">Open something</a>

Problem I have is that I need to open a fancybox IFRAME. Example code or any ideas would be greatly appreciated.

Thanks

I can get this to work which opens a fancybox IMAGE from within an iframe

<a href="javascript:parent.$.fancybox.open({href : 'myurl'});">Open something</a>

Problem I have is that I need to open a fancybox IFRAME. Example code or any ideas would be greatly appreciated.

Thanks

Share Improve this question edited May 2, 2012 at 4:31 danielrt9 asked May 2, 2012 at 1:40 danielrt9danielrt9 552 silver badges8 bronze badges 2
  • Check stackoverflow./a/8855410/1055987 – JFK Commented May 2, 2012 at 2:10
  • possible duplicate of call Fancybox in parent from iframe – JFK Commented May 2, 2012 at 2:13
Add a ment  | 

1 Answer 1

Reset to default 3

Simply, set type iframe:

<a href="javascript:parent.$.fancybox.open({href : 'myurl', type: 'iframe'});">Open something in iframe</a>

But you should do it only when you need to have different options, because you can open other page withing iframe like:

<a href="myurl">Open something in iframe</a>
发布评论

评论列表(0)

  1. 暂无评论