-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
52 lines (41 loc) · 1.44 KB
/
script.js
File metadata and controls
52 lines (41 loc) · 1.44 KB
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
let imgProducto = document.getElementById("imgProducto");
let miniaturas = document.querySelectorAll(".miniaturas img");
function setMini(pos){
if(pos=='0'){
imgProducto.style.transform = "rotateZ(0deg)";
}
if(pos=='1'){
imgProducto.style.transform = "rotateZ(35deg)";
}
if(pos=='2'){
imgProducto.style.transform = "rotateZ(-55deg) scale(0.75)";
}
miniaturas[0].style.backgroundColor = "#fff1d9";
miniaturas[1].style.backgroundColor = "#fff1d9";
miniaturas[2].style.backgroundColor = "#fff1d9";
miniaturas[pos].style.backgroundColor = "#fdc10e";
}
let sizes = document.querySelectorAll(".info-detalle button");
function setSize(pos){
sizes[0].style.backgroundColor = "#fff1d9";
sizes[1].style.backgroundColor = "#fff1d9";
sizes[2].style.backgroundColor = "#fff1d9";
sizes[pos].style.backgroundColor = "#fdc10e";
}
//MENU RESPONSIVE
let menu_responsive_visible = false;
let nav_responsive = document.getElementById("nav-responsive");
let nav = document.getElementById("nav");
let close_responsive = document.getElementById("close-responsive");
nav_responsive.onclick = function(){
if(menu_responsive_visible==false){
nav.className = "menu-responsive";
menu_responsive_visible = true;
}
}
close_responsive.onclick = function(){
if(menu_responsive_visible==true){
nav.className = "";
menu_responsive_visible = false;
}
}