gpt4 book ai didi

php - JQuery colorbox 不适用于 PHP/MySQL

转载 作者:行者123 更新时间:2023-11-30 01:24:29 27 4
gpt4 key购买 nike

我有非常基本的彩盒脚本:

<script src="data/scripts/jquery-1.10.2.min.js"></script>
<script src="/data/scripts/jquery.colorbox.js"></script>

<script>
$(document).ready(function(){
$(".InternalIMG").colorbox({rel:'InternalIMG', transition:"fade"})
});
</script>

静态文档中的一切都有效。

代码示例:

<a class="InternalIMG" href="/data/images/gallery/testing/UK.png" title="Absolutní schéma">
<div class="image_left" style="background-image: url('data/images/gallery/testing/UK.png');"></div>
</a>

但是当我在 PHP 变量中使用它时,它根本不起作用:

      $gal_query = mysql_query("SELECT * FROM gomi_galerie_fotky WHERE section=" . $_GET['id'], $link);
if (mysql_num_rows($gal_query) != 0) {
while($gal_result=mysql_fetch_assoc($gal_query)) {
if ($gallery_count % 3 == 0) {$gallery_rows .= '</tr><tr valign="middle" align="center">';};

$gallery_rows .= '<td width="150px" height="150px" align="center" valign="middle" style="overflow: hidden;"><a class="InternalIMG" href="/data/images/gallery/testing/UK.png" title="Absolutní schéma"><div class="image_left" style="background-image: url(/data/images/gallery/thumbs/' . $gal_result['id'] . '.' . $gal_result['type'] . ');" title="' . $gal_result['body'] . '"></div></a></td>';
$gallery_count++;
}

$gallery = '<table align="center" border="0" width="150px" height="150px" style="table-layout:fixed"><tr valign="middle" align="center">' . $gallery_rows . '</tr></table>';

也许 php 文件有问题(这些 php 变量位于另一个 [included] php 文件中)。

感谢您的帮助。

最佳答案

您应该关闭 if 的大括号。在 php 代码末尾添加 }

关于php - JQuery colorbox 不适用于 PHP/MySQL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18172348/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com