简体   繁体   English

Fancybox不显示iframe内容

[英]Fancybox not displaying iframe contents

I'm having trouble using fancybox to display iframe content in my application. 使用fancybox在应用程序中显示iframe内容时遇到问题。 I'm able to get it work in JSFiddle: http://jsfiddle.net/RHaAX/634/ but not within my application. 我可以在JSFiddle中使用它: http : //jsfiddle.net/RHaAX/634/,但在我的应用程序中却无法。 I've also tried changing the link in the fiddle example to the page I'm trying to display in my application, in case it was something specific about my application, and it still works fine. 我还尝试过将小提琴示例中的链接更改为要在应用程序中显示的页面,以防它是我的应用程序所特有的,并且仍然可以正常工作。

Here are the include I do at the beginning of the .php page 这是我在.php页面开头所做的包含

<script type="text/javascript" src="scripts/js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="scripts/js/jquery-migrate-1.2.1.min.js"></script>
<script type="text/javascript" src="scripts/js/jquery-ui-1.10.4.custom.min.js"></script>
<!-- Add mousewheel plugin (this is optional) -->
<script type="text/javascript" src="scripts/fancybox/jquery.mousewheel-3.0.6.pack.js"></script>
<!-- Add fancyBox main JS and CSS files -->
<script type="text/javascript" src="scripts/fancybox/jquery.fancybox.pack.js?v=2.1.3"></script>
<link rel="stylesheet" type="text/css" href="scripts/fancybox/jquery.fancybox.css?v=2.1.3" media="screen" />
<!-- Add fancyBox - button helper (this is optional) -->
<link rel="stylesheet" type="text/css" href="scripts/fancybox/helpers/jquery.fancybox-buttons.css?v=2.1.3" />
<script type="text/javascript" src="scripts/fancybox/helpers/jquery.fancybox-buttons.js?v=2.1.3"></script>
<!-- Add fancyBox - thumbnail helper (this is optional) -->
<link rel="stylesheet" type="text/css" href="scripts/fancybox/helpers/jquery.fancybox-thumbs.css?v=2.1.3" />
<script type="text/javascript" src="scripts/fancybox/helpers/jquery.fancybox-thumbs.js?v=2.1.3"></script>
<!-- Add fancyBox - media helper (this is optional) -->
<script type="text/javascript" src="scripts/fancybox/helpers/jquery.fancybox-media.js?v=1.0.0"></script>

I've checked the javascript console and indeed the .js and .css files are all found. 我检查了JavaScript控制台,确实找到了.js和.css文件。 Here is the javascript and html I'm using: 这是我正在使用的javascript和html:

<script type="text/javascript">
$(function() {
    $('.fancybox').fancybox({type: "iframe", iframe: {preload: false}});
}
</script>
<a class="fancybox" data-fancybox-type="iframe" title="SGE status" href="pipelines.php?action=viewjob&id=<?=$analysis_qsubid?>">processing</a>

Any idea what might be causing this not to work? 知道是什么原因可能导致此方法不起作用吗?

Seem like you're missing closing ) in your code: 好像您在代码中缺少close )

$(function() {
    $('.fancybox').fancybox({type: "iframe", iframe: {preload: false}});
}); // <-- Here

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM