ColorBox iframe rel(组)

时间:2012-06-29 02:42:21

标签: jquery iframe colorbox rel

我真的卡住..现在一直坐着这个代码..试图用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>

IFRAME

<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>

1 个答案:

答案 0 :(得分:0)

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

PS。喜欢糖果般的嘴唇。