Last active
October 15, 2018 11:40
-
-
Save jsrath/b9b597d9081cf861cb2c5628346f2a54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const right = document.getElementById('buttonRight') | |
right.addEventListener('click', slideRight); | |
function slideRight() { | |
let myCurrent = document.getElementById(positionArray.indexOf(position) + 1); | |
myCurrent.classList.remove('current') | |
position += imageWidth; | |
position %= images * imageWidth; | |
gallery.querySelector('#gallery-inner').style.marginLeft = '-' + position + 'px'; | |
myCurrent = document.getElementById(positionArray.indexOf(position) + 1); | |
myCurrent.classList.add('current') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment