我在我的项目中使用了colorbox来在jQuery弹出窗口中显示一些细节。但目标页面不会出现。
这是代码:
<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看到 有什么问题?
答案 0 :(得分:1)
您正试图在iframe中显示google.com,这并不像其他方面那么容易。 它应该像你几乎任何其他方面一样工作。
阅读本文以获取更多信息:How to show google.com in an iframe?
答案 1 :(得分:0)
我不确定您的目的,但如果您想使用iframe在您的网站上嵌入Google搜索,则可以尝试使用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%"});