0

我真的被卡住了..现在一直坐在这个代码上..尝试用 ColorBox 制作一个画廊,看起来很不错..我只有一个问题..使用 iframe 时我无法让它成为一个组...

http://www.lani.dk/thomas/temp/iframe_problem.zip

地点

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>-</title>

 <link media="screen" rel="stylesheet" href="css/colorbox.css" />
<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.colorbox.js"></script>
<script>
function showColorBox(imageURL) {
$.fn.colorbox({ opacity: .6, open: true, href: imageURL });
}
</script>

 </head>
<body>
<iframe src="iframe.asp" name="iframename" width="400" height="400" frameborder='0'     id="iframename">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>

框架

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>-</title>

<style type="text/css">
body {
background-color: #999;
}
</style>

<script src="scripts/jquery.min.js"></script>
<script src="scripts/jquery.colorbox.js"></script>
<script>
$(document).ready(function () {
 $('a.colorbox').click(function (event) {
    event.preventDefault(); 
    parent.showColorBox($(this).attr("href"));
});
});
</script>

</head>
<body>

<p><a href="images/gallery/pic1.jpg" class="colorbox" rel="group1">pic1</a></p>
<p><a href="images/gallery/pic2.jpg" class="colorbox" rel="group1">pic2</a></p>
<p><a href="images/gallery/pic3.jpg" class="colorbox" rel="group1">pic2</a></p>

</body>
</html>
4

1 回答 1

0

请记住,ColorBox 会在页面加载时扫描 DOM 以获取要呈现的资产。我怀疑该插件在 iframe 中看不到资产,因此无法识别它们。

PS。喜欢糖果般的嘴唇。

于 2012-06-29T15:45:43.027 回答