electerious / electerious/basicLightbox

<picture> tag support

オープン
#37 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
604
フォーク
57
PR マージ指標
30日以内にマージされた PR はありません

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

issue にある 2 つの listener のバリエーションを再現し、単純な img マークアップと picture/source/img マークアップを比較します。basicLightbox.create(...).show() から開始し、表示されたコンテンツと背景へのクリックがどのように処理されるかを追跡します。picture ベースの WebP フォールバック lightbox が、単純な img 版と同様に画像をクリックすると閉じれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。