Created
June 27, 2019 10:18
-
-
Save Hawksbillcat/eb1ebf190886d00b74168e73e3578ba3 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
var slide = document.getElementsByClassName('slide'), | |
rightArrow = document.getElementsByClassName('rightArrow')[0], | |
leftArrow = document.getElementsByClassName('leftArrow')[0]; | |
leftArrow.onclick = function() { | |
var temp = slide[0].getAttribute('class'); | |
slide[0].setAttribute('class', slide[1].getAttribute('class')); | |
slide[1].setAttribute('class', slide[2].getAttribute('class')); | |
slide[2].setAttribute('class', temp); | |
} | |
rightArrow.onclick = function() { | |
var temp = slide[0].getAttribute('class'); | |
console.log(temp); | |
slide[0].setAttribute('class', slide[2].getAttribute('class')); | |
slide[2].setAttribute('class', slide[1].getAttribute('class')); | |
slide[1].setAttribute('class', temp); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment