gpt4 book ai didi

javascript - lightgallery type错误图像未加载?

转载 作者:行者123 更新时间:2023-12-03 07:09:52 24 4
gpt4 key购买 nike

我有一个引导页面,我下载了 jquery 插件 (lightgallery.js),并且插件与这些代码配合得很好;

    <div class="item active" id="lightgallery">
<a href="http://s.fotorama.io/1.jpg">
<img src="http://s.fotorama.io/1.jpg" alt="...">
</a>
<a href="http://s.fotorama.io/2.jpg">
<img src="http://s.fotorama.io/2.jpg" alt="...">
</a>
</div>

这是我的 jquery 函数工作插件

 $('#lightgallery').lightGallery();

这很好,但如果我改变我的 html 结构插件就不起作用

我的html结构如下;

<div id="lightgallery">

<div class="item active">
<a href="http://s.fotorama.io/1.jpg">
<img src="http://s.fotorama.io/1.jpg" alt="...">
</a>
</div>

<div class="item">
<a href="http://s.fotorama.io/2.jpg">
<img src="http://s.fotorama.io/2.jpg" alt="...">
</a>
</div>
</div>

最佳答案

使用这样的列表..

<ul id="lightgallery">
<li class="item active">
<a href="http://s.fotorama.io/1.jpg">
<img src="http://s.fotorama.io/1.jpg">
</a>
</li>
<li class="item">
<a href="http://s.fotorama.io/2.jpg">
<img src="http://s.fotorama.io/2.jpg">
</a>
</li>
</ul>

关于javascript - lightgallery type错误图像未加载?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36653932/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com