简体   繁体   English

lightgallery typeError图片无法加载?

[英]lightgallery typeError images not loading?

I have a bootstrap page and I downloaded jquery plugin (lightgallery.js) and plugins works very well with theese codes; 我有一个引导页面,并且下载了jquery插件(lightgallery.js),并且该插件与theese代码非常兼容;

    <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>

and this is my jquery function to work plugin 这是我的jQuery函数来工作插件

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

it's good but if I change my html structure plugin is not work 很好,但是如果我更改了HTML结构插件,将无法正常工作

my html structure is below; 我的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>

Use a list like this.. 使用这样的列表。

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM