How to open glightbox on loading page? #388
-
How can I set glightbox to open automatically when the page open? |
Beta Was this translation helpful? Give feedback.
Answered by
gingerchew
Dec 1, 2022
Replies: 2 comments
-
You'd have to use an event listener on either the const lightbox = GLightbox();
document.addEventListener('DOMContentLoaded', () => lightbox.open(), { once: true })
// or
window.addEventListener('load', () => lightbox.open(), { once: true }); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mxkeke
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You'd have to use an event listener on either the
DOMContentLoaded
document event or theload
window event.