menu.js
2.18 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
const toggleBtn = document.querySelector('.menu_toggle');
const menu = document.querySelector('.menu_bar_content');
const icons = document.querySelector('.menu_bar_icons');
const x1 = document.querySelector('#use');
const x2 = document.querySelector('#Variables');
const x3 = document.querySelector('#Parameters');
const x4 = document.querySelector('#Basic');
const x5 = document.querySelector('#Loop');
const x6 = document.querySelector('#IF');
const x7 = document.querySelector('#User');
const x8 = document.querySelector('#Bool');
const content1 = document.querySelector('.overall_usage');
const content2 = document.querySelector('.variables');
const content3 = document.querySelector('.parameter');
const content4 = document.querySelector('.basic_func');
const content5 = document.querySelector('.for');
const content6 = document.querySelector('.if');
const content7 = document.querySelector('.def');
const content8 = document.querySelector('.bool');
let temp = document.querySelector('.menu_bar_logo');
toggleBtn.addEventListener('click', () => {
menu.classList.toggle('active');
icons.classList.toggle('active');
})
x1.addEventListener('click', () =>{
temp.classList.toggle('active');
content1.classList.toggle('active');
temp = content1;
})
x2.addEventListener('click', () =>{
temp.classList.toggle('active');
content2.classList.toggle('active');
temp = content2;
})
x3.addEventListener('click', () =>{
temp.classList.toggle('active');
content3.classList.toggle('active');
temp = content3;
})
x4.addEventListener('click', () =>{
temp.classList.toggle('active');
content4.classList.toggle('active');
temp = content4;
})
x5.addEventListener('click', () =>{
temp.classList.toggle('active');
content5.classList.toggle('active');
temp = content5;
})
x6.addEventListener('click', () =>{
temp.classList.toggle('active');
content6.classList.toggle('active');
temp = content6;
})
x7.addEventListener('click', () =>{
temp.classList.toggle('active');
content7.classList.toggle('active');
temp = content7;
})
x8.addEventListener('click', () =>{
temp.classList.toggle('active');
content8.classList.toggle('active');
temp = content8;
})