-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.js
49 lines (41 loc) · 1.23 KB
/
home.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
let menuList = document.getElementById("menuList");
menuList.style.maxHeight = "0px";
function toggleMenu(){
if(menuList.style.maxHeight == "0px"){
menuList.style.maxHeight = "300px";
menuList.style.zIndex = "10";
}
else{
menuList.style.maxHeight = "0px"
}
}
// ticket counter
const plus = document.querySelector(".plus"),
minus = document.querySelector(".minus"),
price = document.querySelector('.price'),
num = document.querySelector(".num");
let a = 1;
plus.addEventListener("click", ()=>{
a++;
a = (a < 10) ? "0" + a : a;
num.innerText = a;
price.innerText = a * 350;
});
minus.addEventListener("click", ()=>{
if(a > 1){
a--;
a = (a < 10) ? "0" + a : a;
num.innerText = a;
price.innerText = a * 350;
}
});
//search bar
const wrapper = document.querySelector('.wrapper2');
const btnPopup = document.querySelector('.btnLogin-pop');
const iconClose = document.querySelector('.icon-close');
btnPopup.addEventListener('click', ()=> {
wrapper.classList.add('active-popup');
});
iconClose.addEventListener('click', ()=> {
wrapper.classList.remove('active-popup');
});