diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/lightbox.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/content/lightbox.js b/content/lightbox.js index d6115b4..4ec959d 100644 --- a/content/lightbox.js +++ b/content/lightbox.js | |||
@@ -5,6 +5,7 @@ | |||
5 | const mainEl = document.querySelector("main"); | 5 | const mainEl = document.querySelector("main"); |
6 | const lightboxEl = document.querySelector(".c-lightbox"); | 6 | const lightboxEl = document.querySelector(".c-lightbox"); |
7 | const lightboxBgEl = lightboxEl.querySelector(".c-lightbox__bg"); | 7 | const lightboxBgEl = lightboxEl.querySelector(".c-lightbox__bg"); |
8 | const lightboxCountEl = lightboxEl.querySelector(".c-lightbox__count"); | ||
8 | const lightboxCloseEl = lightboxEl.querySelector(".c-lightbox__close"); | 9 | const lightboxCloseEl = lightboxEl.querySelector(".c-lightbox__close"); |
9 | const lightboxPrevEl = lightboxEl.querySelector(".c-lightbox__prev"); | 10 | const lightboxPrevEl = lightboxEl.querySelector(".c-lightbox__prev"); |
10 | const lightboxNextEl = lightboxEl.querySelector(".c-lightbox__next"); | 11 | const lightboxNextEl = lightboxEl.querySelector(".c-lightbox__next"); |
@@ -24,6 +25,7 @@ | |||
24 | const setIndex = (i) => { | 25 | const setIndex = (i) => { |
25 | currentIndex = i; | 26 | currentIndex = i; |
26 | lightboxImgEl.src = figureEls[i].href; | 27 | lightboxImgEl.src = figureEls[i].href; |
28 | lightboxCountEl.textContent = (i + 1) + " / " + figureEls.length; | ||
27 | lightboxPrevEl.classList.toggle("u-dn", i === 0); | 29 | lightboxPrevEl.classList.toggle("u-dn", i === 0); |
28 | lightboxNextEl.classList.toggle("u-dn", i === figureEls.length - 1); | 30 | lightboxNextEl.classList.toggle("u-dn", i === figureEls.length - 1); |
29 | }; | 31 | }; |