sachinchoolur / lightgallery.js

Full featured JavaScript image & video gallery. No dependencies
https://sachinchoolur.github.io/lightgallery.js/
Other
5.3k stars 596 forks source link

lightGallery has not initiated properly #95

Closed mrcode86 closed 3 years ago

mrcode86 commented 6 years ago

Hi,

I try to use lightgallery with vuejs. I have created a component and use this:

mounted: function () {
        //document.getElementsByClassName("timeline-media");

        var targets = this.$refs.timelinemedia;
        if (!targets) return;
        console.log(targets);
        lightGallery(targets);
    }

I have tried booth refs and get the div by the id/class name and i get the same error message: lightGallery has not initiated properly. When i check the error message i can se this: _lgUtils2.default is undefined

Whats wrong?

usb248 commented 6 years ago

same problem

viliusle commented 6 years ago

Same problem when using js from jsdelivr cdn. But taking js from github cdn works fine. oO

zdb commented 5 years ago

If you are using the jsDeliver CDN you need to de-select all the files and select the dist directory instead so your url will look like this:

https://cdn.jsdelivr.net/npm/lightgallery.js@1.1.1/dist/js/lightgallery.min.js

image

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. If the issue is still valid for version 2.x, please re-open. Apologize for not responding on time. Thank you for your contributions.