lightGallery icon indicating copy to clipboard operation
lightGallery copied to clipboard

Issue when using carousel gallery without dynamicEl

Open fab918 opened this issue 11 months ago • 1 comments

Description

I don't know if it's a bug or a misunderstanding, I'm trying to use the Carousel Gallery code but without the dynamicEL (because I want to use html tags for the slides as I don't use a JS framework).

The result is broken:

Screenshot 2024-03-01 at 16 19 18

(it works fine with dynamicEl but the approach doesn't suit my project)

JS code that you use to initialize lightGallery.

const lgContainer = document.getElementById('inline-gallery-container');
const inlineGallery = lightGallery(lgContainer, {
    container: lgContainer,
    dynamic: false,
    hash: false,
    closable: false,
    showMaximizeIcon: true,
    appendSubHtmlTo: '.lg-item',
    slideDelay: 400,
   plugins: [lgZoom, lgThumbnail],
});

Sample HTML markup

     <div id="inline-gallery-container" class="inline-gallery-container">
        <a href="https://picsum.photos/1400/700"  data-src="https://picsum.photos/1400/700" data-thumb="https://picsum.photos/700/350" data-subHtml="<p>test</p>" >
           <img src="https://picsum.photos/1400/700" />
        </a>
        <a href="https://picsum.photos/1400/700"  data-src="https://picsum.photos/1400/700" data-thumb="https://picsum.photos/700/350" data-subHtml="<p>test</p>">
           <img src="https://picsum.photos/1400/700"  />
        </a>
     </div>

Version

I use the version 2.7.2 for my tests:

      <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/lightgallery/2.7.2/css/lightgallery-bundle.min.css">
 <script src="https://cdn.jsdelivr.net/combine/npm/[email protected]/lightgallery.min.js,npm/[email protected]/plugins/zoom/lg-zoom.min.js,npm/[email protected]/plugins/thumbnail/lg-thumbnail.min.js"></script>
   

fab918 avatar Mar 01 '24 15:03 fab918

Current implementation of the inline carousel using LightGallery works with dynamic: true and the dynamicEl array specified. Within the Lightbox, it requires only the attributes; the rest of the tags are automatically generated by Lightbox itself.

bytesandbots3 avatar Mar 06 '24 16:03 bytesandbots3

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 09 '24 00:05 stale[bot]