diff options
Fixed image show script when img has multiple classes
1 files changed, 1 insertions, 1 deletions
| -rw-r--r-- | src/scripts/image-show.js | 2 |
diff --git a/src/scripts/image-show.js b/src/scripts/image-show.js index 1683107..b1ca7cf 100644 --- a/src/scripts/image-show.js +++ b/src/scripts/image-show.js @@ -9,7 +9,7 @@ function clickToView() { this.classList.toggle('clicked-image'); document.body.classList.toggle('body-on-clicked-image'); - if (this.className.length === 0) { + if (!this.classList.contains('clicked-image')) { window.scrollTo(0, scrollPosition); scrollPosition = 0; } |