before_close event #499
-
I would like to ask, if there is a before_close event or if not, if there is a way for some sort of workaround? Reason is, i have added some custom buttons and i use the close button, to position these buttons next to each other. If i now close the picture, the buttons disappear also, but only after some time. This means, a gallery with white background will display the buttons for a blink of a second, between the image is closed and the buttons are completely fade out. This is not the a big issue, only a small disadvantage. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
No but you could add an event listener in the lightbox.on('open', () => {
document.querySelector({{ the glightbox close button selector }})
.addEventListener('click', () => {
// do cleanup stuff
}, { once: true })
}) |
Beta Was this translation helpful? Give feedback.
-
Many thx. Works perfectly. BTW: I wasn't aware, that there is a For reference, im using it in https://codeberg.org/Offerel/roundcube_pictures. This is a photo plugin for Roundcube. |
Beta Was this translation helpful? Give feedback.
No but you could add an event listener in the
open
event to the close button, then you can do any cleanup work you need to do in that handler.