2013-08-07 27 views
0

我在我的項目中使用了colorbox來顯示jQuery彈出窗口中的一些細節。但目標頁面不出現。
這是代碼:爲什麼Colobox iframe不能打開頁面?

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<link rel="stylesheet" href="css/colorbox.css" type="text/css" /> 
<script src="js/jquery.js" type="text/javascript"></script> 
<script type="text/javascript" src="js/jquery.colorbox.js"></script> 
<script type="text/javascript"> 
$(document).ready(function(e) { 
    $(".iframe").colorbox({iframe:true, width:"70%", height:"70%"}); 
}); 
</script> 
</head> 

<body> 
<a href="http://www.google.com" class="iframe" style="color:#333">Click here</a> 
</body> 
</html> 

您可以在Here看到。
有什麼問題?

回答

1

您正嘗試在iframe中顯示google.com,這不像其他方面那麼容易。 它應該像你幾乎任何其他方面一樣工作。

閱讀以瞭解更多信息:How to show google.com in an iframe?

0

我不知道你的目的,但如果你要嵌入在您的網站的iframe谷歌的搜索,你可以嘗試http://www.google.com/custom。 你可以在這裏看到演示http://jsfiddle.net/devchill/LVunZ/

<a href="http://www.google.com/custom" class="iframe" style="color:#333">Click here</a> 

$(".iframe").colorbox({iframe:true, width:"70%", height:"70%"});