简体   繁体   中英

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;

    <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

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

it's good but if I change my html structure plugin is not work

my html structure is below;

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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