我正在使用Justified-Gallery 来布局我的图库缩略图。我想实现一个预加载器,这样图像只有在被Justified-Gallery格式化后才会显示。使用对齐图库预加载图像
我在插件中看到了这个选项,但是我无法启动它,waitThumbnailsLoad。
目前我隐藏了包含缩略图的div,然后在插件完成后显示它。这是最好的方法还是有更好的方法来做到这一点?
HTML
<div id="justify-gallery" class="hidden">
// thumbnails go here
</div>
JS
// Justify Gallery
$("#justify-gallery").justifiedGallery({
rowHeight: 100,
fixedHeight: true,
captions: false,
margins: 3,
lastRow: 'nojustify'
});
$('#justify-gallery').justifiedGallery().on('jg.complete', function (e) {
$(this).fadeIn();
});
谢谢,关于加载动画的好主意 –