无法循环通过jquery灯箱

时间:2010-09-07 09:22:27

标签: php jquery lightbox

我使用jquery think box作为灯箱它正常工作,但如果我循环通过PHP它失败..

<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="Description" content="ThickBox is a webpage UI dialog widget written in javascript on top of the jQuery library. It's function is too show a single image, multiple images, inline content, iframed content, and content served through AJAX in a hybrid modal." />
<meta name="author" content="Cody Lindley" />
<meta name="robots" content="all" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<meta http-equiv="imagetoolbar" content="false" />

<title>ThickBox 3.1</title>

<style type="text/css" media="all">
@import "css/global.css";
@import "thickbox-code/thickbox.css";
</style>

<link rel="alternate stylesheet" type="text/css" href="css/1024.css" title="1024 x 768" />
<link rel="alternate stylesheet" type="text/css" href="css/thickbox.css" title="1024 x 768" />
<script src="js/jquery-1.1.3.1.pack.js" type="text/javascript"></script>
<script src="js/thickbox-compressed.js" type="text/javascript"></script>
<script src="js/global.js" type="text/javascript"></script>
<script src="js/thickbox.js" type="text/javascript"></script>
</head>

<body id="pageTop">
<?php
for($i=0;$i<10;$i++)
{?>
 <a href="#TB_inline?height=155&amp;width=300&amp;inlineId=hiddenModalContent&amp;modal=true" class="thickbox"><?php echo $i;?></a>
<div id="hiddenModalContent" style="display:none">
<p><?php echo $i;?></p>
<p style="text-align:center"><input type="submit" id="Login" value="&nbsp;&nbsp;Ok&nbsp;&nbsp;" onclick="tb_remove()" /></p>
</div>
<?php
}
?>

任何人都可以告诉我该怎么办

1 个答案:

答案 0 :(得分:0)

在链接中添加rel标记,即。相对=“画廊”。这应该可以解决问题。

请参阅“为每个链接元素指定相同的rel元素和值。(例如:rel =”gallery-plants“)”在http://jquery.com/demo/thickbox/