electerious / electerious/basicLightbox
<picture> tag support
- Dominant language
- JavaScript
- Stars
- 604
- Forks
- 57
- PR merge metrics
- No merged PRs in 30d
Description
I am trying to add support for webp image formats with jpg fallbacks. When I write my listener like this the lightbox works as intended:
```
window.addEventListener('load', (event) => {
document.querySelectorAll('.modal').forEach(image => {
image.addEventListener('click', e => {
basicLightbox.create(`
`).show();
});
});
});
```
However, when I write my listener like this, the lightbox does not close when I click on the image, only when I click on the background, making the lightbox difficult to close:
```
window.addEventListener('load', (event) => {
document.querySelectorAll('.modal').forEach(image => {
image.addEventListener('click', e => {
basicLightbox.create(`
`).show();
});
});
});
```
I imagine this has something to do with the `` tag. Any thoughts on why this would be happening? Thanks
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.