0

私は本当に基本的なカラーボックススクリプトを持っています:

<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変数は別の[含まれる] phpファイルにあります)。

お手伝いありがとうございます。

4

1 に答える 1

0

の中括弧を閉じる必要がありifます。}PHP コードの末尾にa を追加します。

于 2013-08-11T13:26:31.400 に答える