lightgallery.js implimentation
trying to implement a lightbox using
lightgallery.js
my html looks like this
and javascript is this
i tried using this cdn in head
as well as before body
tag. but it's not working.
Site link: https://liquid-navbar-88222e.webflow.io/portraits
What am I doing wrong?5 Replies
no one here?
maybe I'm missing something, but I don't see it referenced in the site you linked at all
what's probably happening though, when you do reference the script, is that the
lightgallery.js
script isn't loaded and run by the time the script at the bottom of the page is run, so lightGallery
isn't defined and can't workso
defer
would do the job?you can't defer inline scripts
I think you'll have to run
lightGallery()
inside an onload event listener for the windowgot it, thank you