-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
71 lines (53 loc) · 1.33 KB
/
index.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*CARROUSEL*/
var imgCarrousel = ['images/photo.jpg', 'images/niños.jpg', 'images/img3.jpg'];
var cont=0;
const container = document.querySelector('.benefits__content--img');
document.addEventListener("DOMContentLoaded", ()=>{
setInterval(startInterval,2500);
})
function startInterval(){
moveCarrousel(container);
}
function moveCarrousel(container){
imgBenefits = container.querySelector('.imgBenefits');
if(cont==0){
imgBenefits.src = imgCarrousel[cont];
cont++;
} else if(cont==1){
imgBenefits.src = imgCarrousel[cont];
cont++;
} else if (cont==2){
imgBenefits.src = imgCarrousel[cont];
cont=0;
}
}
function nextImage(){
if(cont==2){
cont=0;
} else{
cont++;
}
imgBenefits = container.querySelector('.imgBenefits');
imgBenefits.src = imgCarrousel[cont];
}
function prevImage(){
if(cont==0){
cont=2;
} else{
cont--;
}
imgBenefits = container.querySelector('.imgBenefits');
imgBenefits.src = imgCarrousel[cont];
}
/*SHOW CONTACT SECTION*/
const contact = document.querySelector('.contact');
var click = 1;
function showContact(){
if(click==1){
contact.style.display="block";
click=0;
} else{
contact.style.display="none";
click=1;
}
}