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

Error when using plugin (triggered when testing the provided example) #538

Open
victornoleto opened this issue Oct 22, 2024 · 0 comments
Open

Comments

@victornoleto
Copy link

Describe the bug
When testing the plugin the error below appears:

vendor.min.js:61444 Uncaught TypeError: slideTriggerNode.getAttribute is not a function
    at GlightboxInit.resize (vendor.min.js:61444:76)
    at vendor.min.js:60832:20
    at vendor.min.js:59932:15
    at Image.<anonymous> (vendor.min.js:59474:9)

Are you able to reproduce the bug in the demo site
No.

To Reproduce

  1. npm install glightbox;
  2. Imported node_modules/glightbox/dist/js/glightbox.js and node_modules/glightbox/dist/css/glightbox.css;
  3. Wrote a javascript file containing the following example:
// Instead of using a selector, define the gallery elements
const myGallery = GLightbox({
    elements: [
        {
            'href': 'https://picsum.photos/1200/800',
            'type': 'image',
            'title': 'My Title',
            'description': 'Example',
        },
        {
            'href': 'https://picsum.photos/1200/800',
            'type': 'image',
            'alt': 'image text alternatives'
        },
        {
            'href': 'https://www.youtube.com/watch?v=Ga6RYejo6Hk',
            'type': 'video',
            'source': 'youtube', //vimeo, youtube or local
            'width': 900,
        },
        {
            'content': '<p>This will append some html inside the slide</p>' // read more in the API section
        },
        {
            'content': document.getElementById('inline-example') // this will append a node inside the slide
        },
    ],
    autoplayVideos: true,
});
myGallery.open();

Expected behavior
Plugin works normally.

Post the code you are using
Described above.

Screenshots
2024-10-22_16-55

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant