diff options
author | Matthew Kosarek <mattkae@protonmail.com> | 2021-10-06 06:18:34 -0400 |
---|---|---|
committer | Matthew Kosarek <mattkae@protonmail.com> | 2021-10-06 06:18:34 -0400 |
commit | 2074f6be3096386fb543f040dec314290f6eb920 (patch) | |
tree | 440937029064df9452b5f0cf4d042631fc171b93 /index.js | |
parent | b1388b40b138e4440cda121b8044b26ae35759ef (diff) |
Fixed the carousel
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -37,7 +37,8 @@ function runCarousel() { function updateCarousel() { var children = imageContainer.children, - selectedChildPosition = -imageContainer.children[carouselPosition].offsetLeft + 240; + numChildren = imageContainer.children.length, + selectedChildPosition = -(carouselPosition * 240); imageContainer.style.transform = 'translate(' + selectedChildPosition + 'px, 0)'; for (var i = 0; i < children.length; i++) { var image = children[i]; |