-
Notifications
You must be signed in to change notification settings - Fork 0
/
js.js
36 lines (25 loc) · 886 Bytes
/
js.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
let cambias = document.getElementById("next")
let regresa = document.getElementById("previus")
let imagen1 = document.getElementById("imagen1")
let imagen2 = document.getElementById("imagen2")
let imagen3 = document.getElementById("imagen3")
let contador = -1
function cambia(){
contador ++
console.log(contador)
if(contador === 1){
imagen1.style.display = "none"
imagen3.style.display = "none"
imagen2.style.display = "block"
}else if(contador === 3){
imagen2.style.display = "none"
imagen1.style.display = "none"
imagen3.style.display = "block"
}else if(contador === 5){
imagen1.style.display = "block"
imagen3.style.display = "none"
imagen2.style.display = "none"
contador = -1
}
}
cambias.addEventListener("click",cambia)