You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

4×4网格画廊显示异常求助:移动端正常,Isotope配置调整无效

4×4网格画廊布局异常排查求助

我正在开发画廊功能,该画廊采用4×4网格布局,但网格显示异常,移动端显示正常。尝试调整Isotope配置、修改服务端代码均未解决问题,无法定位具体故障。

问题截图

Gallery Image
Gallery Image

服务端代码片段

else {

    $ks = 0;

    $getAllImagesByCategoryId = $user->getAllImagesByCategoryId($getImageCategoryDetailById['id']);


    while ($getAllImagesNVideosRow = $user->fetch($getAllImagesByCategoryId)) {

        $file_name = str_replace('', '-', strtolower(pathinfo($getAllImagesNVideosRow['image_name'], PATHINFO_FILENAME)));
        $ext = pathinfo($getAllImagesNVideosRow['image_name'], PATHINFO_EXTENSION);
?>
        <div class="grid-item col-sm-3 grid-item--height2 gallery-image" data-category="photo-galleryimage" <?php if ($ks % 4 == 0)  ?>>

            <a class="popup-image" data-fancybox="images" data-caption="<?php echo $getAllImagesNVideosRow['description']; ?>" href="<?php echo BASE_URL; ?>/images/gallery/<?php echo $file_name . '_large.' . $ext; ?>" data-rel="lightcase:photoGallery">
                <img src="data:image/png;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" data-title="<?php echo $getAllImagesNVideosRow['description']; ?>" data-src="<?php echo BASE_URL; ?>/images/gallery/<?php echo $file_name . '_crop.' . $ext; ?>" alt="<?php echo $getAllImagesNVideosRow['events_title']; ?>">

            </a>
            <div class="item-content">
                <h3><?php echo $getAllImagesNVideosRow['events_title']; ?></h3>
                <span> <?php echo date("d-M-Y", strtotime($getAllImagesNVideosRow['created'])); ?></span>
            </div>
        </div>

<?php

    }
?>
<?php
}

?>

多次调整Isotope配置仍未解决问题,无法确定具体故障原因。

内容的提问来源于stack exchange,提问作者Pratik zajam

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.09 06:15:17