-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
30 lines (26 loc) · 917 Bytes
/
script.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
//navbar//
let navbar=document.querySelector('.navbar');
document.querySelector('#menu-btn').onclick= () =>{
navbar.classList.toggle('active');
searchform.classList.remove('active');
cartitem.classList.remove('active');
}
//cart item//
let cartitem=document.querySelector('.cart-item-container');
document.querySelector('#cart-btn').onclick= () =>{
cartitem.classList.toggle('active');
navbar.classList.remove('active');
searchform.classList.remove('active');
}
//search form//
let searchform=document.querySelector('.search-form');
document.querySelector('#search-btn').onclick= () =>{
searchform.classList.toggle('active');
navbar.classList.remove('active');
cartitem.classList.remove('active');
}
window.onscroll=()=>{
navbar.classList.remove('active');
searchform.classList.remove('active');
cartitem.classList.remove('active');
}