0

jquery 可排序代码有问题 - 与其说是 jquery,不如说是我的图像列表如何显示。在添加可排序代码之前,它完美地将我的包装器中的图像显示在一个网格中 - 现在我从 jquery 添加了一个小样式,它似乎已经抛出了它,但我不知道为什么......

这是 Jquery 风格:

<style>
#sortable { list-style-type: none; margin: 0; padding: 0; width: 450px; }
#sortable li {float: left; }
</style>

这是我之前完美运行的图像列表:

<div id="images">
    <hr style="margin-top: 10px" />
    <ul id="sortable">
      <?php
        // get folio for user
        if(isset($_GET['userid'])) {
            $query = 'SELECT * FROM folio WHERE userid=\'' . $_GET['userid'] . '\' ORDER BY ord';
        }
        else {
            $query = 'SELECT * FROM folio WHERE userid=\'' . $_SESSION['userid'] . '\' ORDER BY ord';
        }
        $result = mysqli_query($connection, $query);
        if(!$result) {
            // error with MYSQL
            die('Failed to retrieve images! - ' . mysqli_error($connection));
        }
        // list images
        $numRows = mysqli_num_rows($result);
        if($numRows < 1) {
            echo '';
        }
        else {
            $filepath = 'uploads/folio/';
            while($imagerow = mysqli_fetch_assoc($result)) { 
        ?>
      <li>
        <div class="outimgbox"> <a class="fancybox fancybox.ajax" rel="gallery1" style="text-decoration: none;" data-fancybox-type="ajax" href="profile_image_fancybox.php?imgid=<?php echo $imagerow['imgid']; ?>">
          <div id="mainwrapper">
            <div id="box-3" class="box"> <img class="uploads" src="<?php echo $filepath . $imagerow['filename']; ?>" alt="<?php echo $imagerow['description']; ?>"/> <span class="caption fade-caption">
              <h3 ><?php echo $imagerow['title']; ?></h3>
              </span> </div>
          </div>
          </a> </div>
      </li>

      <!-- class outingbox -->
      <?php }} ?>
    </ul>
4

1 回答 1

0

出于某种奇怪的原因:

<style>
#sortable { list-style-type: none;  }
#sortable li {float: left; }
</style>

这解决了问题....

于 2013-08-12T17:40:43.787 回答