嗨,我在用我的跳汰机图库实现轻型灯箱时遇到了困难。跳汰机生成的库代码如下所示:
<div id="jig2" class="justified-image-grid jig-eec93aceb26f618c747e9fe2abded7ce jig-preset-c1" style="width: 1278px;">
<div class="jig-imageContainer jig-contentID-ML-1191">
<div class="jig-overflow" style="opacity: 1; width: 658px; height: 438px;">
<a class="jig-link lulz jig-loaded" rel="jig[2]" test="lala" href="http://127.0.0.1/wp/wp-content/uploads/2014/11/untitled-imgp1913.jpg">
<img src="http://127.0.0.1/wp/wp-content/plugins/justified-image-grid/timthumb.php?src=http%3A%2F%2F127.0.0.1%2Fwp%2Fwp-content%2Fuploads%2F2014%2F11%2Funtitled-imgp1913.jpg&h=1040&w=1560&q=45&f=.jpg" width="658" height="439" style="width: 658px; height: 439px; margin-top: 0px;"></a>
</div>
</div>
<div class="jig-imageContainer jig-contentID-ML-1190 jig-last">
<div class="jig-overflow" style="opacity: 1; width: 614px; height: 438px;">
<a class="jig-link lulz jig-loaded" rel="jig[2]" test="lala" href="http://127.0.0.1/wp/wp-content/uploads/2014/11/untitled-imgp1912.jpg">
<img src="http://127.0.0.1/wp/wp-content/plugins/justified-image-grid/timthumb.php?src=http%3A%2F%2F127.0.0.1%2Fwp%2Fwp-content%2Fuploads%2F2014%2F11%2Funtitled-imgp1912.jpg&h=1040&w=1456&q=45&f=.jpg" width="614" height="439" style="width: 614px; height: 439px; margin-top: 0px;"></a>
</div>
</div>
<div class="jig-imageContainer jig-contentID-ML-1192 jig-last">
<div class="jig-overflow" style="opacity: 1; width: 634px; height: 448px;">
<a class="jig-link lulz jig-loaded" rel="jig[2]" test="lala" href="http://127.0.0.1/wp/wp-content/uploads/2014/11/untitled-imgp1915.jpg">
<img src="http://127.0.0.1/wp/wp-content/plugins/justified-image-grid/timthumb.php?src=http%3A%2F%2F127.0.0.1%2Fwp%2Fwp-content%2Fuploads%2F2014%2F11%2Funtitled-imgp1915.jpg&h=1040&w=1472&q=45&f=.jpg" width="634" height="448" style="width: 634px; height: 448px; margin-top: 0px;"></a>
</div>
</div>遵循准则( http://sachinchoolur.github.io/lightGallery/demos/html-markup.html ),我尝试了以下代码,但没有成功。当我单击图片库项目时,没有加载光明库:
JS
<script type="text/javascript">
$(document).ready(function() {
$('.justified-image-grid').lightGallery({
selector: '.lulz'
});
});
</script>
<script type="text/javascript">
$('.justified-image-grid').lightGallery({
selector: '.lulz'
});
</script>
<script type="text/javascript">
$('.justified-image-grid').lightGallery();
</script>
<script type="text/javascript">
$('#jig2').lightGallery();
</script>我可以加载load图库,但它不会显示带有此跳汰机默认设置的自定义灯箱图像:
<script type="text/javascript">
$('#jig2 a.jig-link').lightGallery();
</script>或在图库中加载单个图像。
<script type="text/javascript">
$('.lulz').lightGallery({
selector: 'this'
});
</script>复制演示也很有效..。上个星期我开始工作了,但是我的编码过程失败了。所以我知道一定有解决办法,我就是找不到了。
发布于 2015-12-05 14:10:16
解决了,我在我的代码中找到了另一个轻型图片库标记,我可能忘了删除。
现在,当用作跳汰机的自定义lightbox调用时,此代码可以工作:
$('.justified-image-grid').lightGallery({
selector: '.lulz'
});和
$('#jig1').lightGallery({
selector: '.lulz'
});也很管用。但是,我只对页面上的第一个库工作,后续的库即使在使用
$('#jig2').lightGallery({
selector: '.lulz'
});发布于 2015-12-05 18:18:49
$(JIG_selector).lightGallery({selector: '.lulz'});以跳汰机设置>灯箱选项卡>自定义灯箱JS调用。
https://stackoverflow.com/questions/34100843
复制相似问题