砌体网格在负载下折叠

时间:2018-04-27 08:56:23

标签: javascript jquery-masonry masonry

砌体网格可以正常工作,但图像会相互折叠而无法正确加载。

我们无法使用jquery或js脚本标签使其工作,因此我们添加了html方式

<h2>Recent Resin Bound Driveway Installations</h2>
        <div class="grid" data-masonry='{ "itemSelector": ".grid-item", "columnWidth": 200 }'>
        <div class="grid-item">
            <img src="img/resindriveway1.jpg" alt="Resin Bound Driveway">
        </div><!--ends four-->
        <div class="grid-item">
            <img src="img/product-resin-bound2.jpg" alt="Resin Bound Driveway">
        </div><!--ends four-->
        <div class="grid-item">
           <img src="img/resin-1.jpg" alt="Resin Bound Driveway">
        </div><!--ends four-->
        <div class="grid-item">
            <img src="img/resin4.jpg" alt="Resin Bound Driveway">
        </div><!--ends four-->
        <div class="grid-item">
            <img src="img/resin5.jpg" alt="Resin Bound Driveway">
        </div><!--ends four-->
        <div class="grid-item">
            <img src="img/resin1.jpg" alt="Resin Bound Driveway"></a>
        </div><!--ends four-->
        <div class="grid-item">
            <img src="img/resin-new1.jpg" alt="Resin Bound Driveway">
        </div><!--ends four-->
        <div class="grid-item">
            <img src="img/resin-new4.jpg" alt="Resin Bound Driveway"></a>
        </div><!--ends four-->
        <div class="grid-item">
            <img src="img/resin-new2.jpg" alt="Resin Bound Driveway">
        </div><!--ends four-->
        <div class="grid-item">
            <img src="img/resin3.jpg" alt="Resin Bound Driveway"></a>
        </div><!--ends four-->
        <div class="grid-item">
            <img src="img/resin-new5.jpg" alt="Resin Bound Driveway"></a>
        </div><!--ends four-->
        <div class="grid-item">
            <img src="img/resin2.jpg" alt="Resin Bound Driveway"></a>
        </div><!--ends four-->
        <div class="grid-item">
            <img src="img/resin8.jpg" alt="Resin Bound Driveway">
        </div><!--ends four-->
      </div>

将masonry脚本文件加载到头部但没有区别,因为在页脚中加载时仍然会损坏。

1 个答案:

答案 0 :(得分:0)

因为我没有足够的业力作为评论发布:

您使用的是砖石和#34; imagesLoaded&#34;功能? 这将等待所有图像在应用砌体之前加载