Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when using carousel gallery without dynamicEl #1601

Closed
fab918 opened this issue Mar 1, 2024 · 2 comments
Closed

Issue when using carousel gallery without dynamicEl #1601

fab918 opened this issue Mar 1, 2024 · 2 comments
Labels

Comments

@fab918
Copy link

fab918 commented Mar 1, 2024

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>
   
@bytesandbots3
Copy link
Contributor

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.

Copy link

stale bot commented May 9, 2024

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 stale bot added the v1 label May 9, 2024
@stale stale bot closed this as completed May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants