-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
37 lines (31 loc) · 1.01 KB
/
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
31
32
33
34
35
36
37
const bar = document.getElementById('bar');
const close = document.getElementById('close');
const nav = document.getElementById('navbar');
if (bar) {
bar.addEventListener('click', () => {
nav.classList.add('active')
})
}
if (close) {
close.addEventListener('click', () => {
nav.classList.remove('active')
})
}
// const searchBox = document.querySelector('.search-box');
// const searchBtn = document.querySelector('.search-btn');
// const search = document.querySelector('.search');
// const closeBtn = document.querySelector('.close-box');
// searchBtn.addEventListener('click', function(){
// console.log(search.classList.contains('active'))
// if(search.classList.contains('active')){
// searchBox.value = ''
// }
// else{
// search.classList.add('active');
// searchBox.focus();
// }
// })
// closeBtn.addEventListener('click', function(){
// search.classList.remove('active');
// searchBox.value = '';
// })