-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
37 lines (33 loc) · 1.11 KB
/
index.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
document.addEventListener('DOMContentLoaded', () => {
let home = document.querySelector('.home')
let contact = document.querySelector('.contact')
let homeBtn = document.querySelector('.home-btn');
let contactBtn = document.querySelector('.contact-btn');
let vx = document.querySelector('.vx');
let vximg = document.querySelector('.vx-img');
let qqgroup = document.querySelector('.qqgroup');
let qqgroupimg = document.querySelector('.qqgroup-img');
home.classList.add('show');
homeBtn.addEventListener('click', (e) => {
home.classList.remove('show');
contact.classList.add('show');
})
contactBtn.addEventListener('click', (e) => {
contact.classList.remove('show');
home.classList.add('show');
})
vx.addEventListener('click', (e) => {
e.preventDefault();
vximg.classList.add('show');
})
vximg.addEventListener('click', (e) => {
vximg.classList.remove('show');
})
qqgroup.addEventListener('click', (e) => {
e.preventDefault();
qqgroupimg.classList.add('show');
})
qqgroupimg.addEventListener('click', (e) => {
qqgroupimg.classList.remove('show');
})
})