2014-02-19 210 views
0

我在使用fancybox在我的應用程序中顯示iframe內容時遇到問題。我能夠在JSFiddle中工作:http://jsfiddle.net/RHaAX/634/,但不在我的應用程序中。我也嘗試將小提琴示例中的鏈接更改爲我嘗試在我的應用程序中顯示的頁面,以防它對我的應用程序有特定的意義,並且它仍能正常工作。Fancybox不顯示iframe內容

這裏是包括我在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> 

我檢查JavaScript控制檯和確實的.js和.css文件都發現的開始做。這裏是我使用的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> 

任何想法可能會導致這不起作用?

回答

0

看起來像你錯過了在你的代碼關閉)

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

看起來像我錯過了);當將代碼複製到這裏時,但在我的應用程序中它是正確的 –