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

I can get this to work which opens a fancybox IMAGE from within an iframe<a href="javascript:pa

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>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745118566a4612278.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信