Javascript 在fancybox中打开html页面

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9020084/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 08:25:00  来源:igfitidea点击:

Open html page within fancybox

javascripthtmlcssfancybox

提问by Itzik984

Ive looked for some examples online but i couldn't fund any.

我在网上找了一些例子,但我找不到任何资金。

how can i upload a new html within fancybox?

如何在fancybox中上传新的html?

 $('#Create').click(function() {
 $.fancybox({

 What should be the content over here?
 (lets say i want to load stackoverflow.com)

 });

回答by Andres Ilich

The documentation is right on the site, you can use an iframe:

文档就在网站上,您可以使用 iframe:

$("#iframe").fancybox({
    'width'         : '75%',
    'height'        : '75%',
    'autoScale'     : false,
    'transitionIn'  : 'none',
    'transitionOut' : 'none',
    'type'          : 'iframe'
});

HTML

HTML

<a href="http://www.example?iframe">This goes to iframe</a>

or

<a id="iframe" href="http://www.example">This goes to iframe</a>

You can find all that info here: http://fancybox.net/howto

你可以在这里找到所有这些信息:http: //fancybox.net/howto