-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharticle_handler.js
More file actions
64 lines (58 loc) · 2.07 KB
/
article_handler.js
File metadata and controls
64 lines (58 loc) · 2.07 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
const scenticity = document.getElementById("scenticity")
const gallery = document.getElementById("gallery")
const linux = document.getElementById("linux")
const scenticity_article = document.getElementById("scenticity_article")
const gallery_article = document.getElementById("gallery_article")
const linux_article = document.getElementById("linux_article")
const scenticity_aside = Array.from(document.getElementsByClassName("scenticity_aside"))
const gallery_aside = Array.from(document.getElementsByClassName("gallery_aside"))
const linux_aside = Array.from(document.getElementsByClassName("linux_aside"))
console.log(scenticity_aside, gallery_aside, linux_aside)
scenticity.addEventListener("click",()=>{
if(scenticity_article.classList.contains("hidden")){
scenticity_article.classList.remove("hidden")
scenticity_aside.forEach(e => {
e.classList.remove("hidden")
})
}
gallery_article.classList.add("hidden")
linux_article.classList.add("hidden")
gallery_aside.forEach(e => {
e.classList.add("hidden")
})
linux_aside.forEach(e => {
e.classList.add("hidden")
})
})
gallery.addEventListener("click", ()=>{
if(gallery_article.classList.contains("hidden")){
gallery_article.classList.remove("hidden")
gallery_aside.forEach(e => {
e.classList.remove("hidden")
})
}
scenticity_article.classList.add("hidden")
linux_article.classList.add("hidden")
scenticity_aside.forEach(e => {
e.classList.add("hidden")
})
linux_aside.forEach(e => {
e.classList.add("hidden")
})
})
linux.addEventListener("click", ()=>{
if(linux_article.classList.contains("hidden")){
linux_article.classList.remove("hidden")
linux_aside.forEach(e => {
e.classList.remove("hidden")
})
}
scenticity_article.classList.add("hidden")
gallery_article.classList.add("hidden")
scenticity_aside.forEach(e => {
e.classList.add("hidden")
})
gallery_aside.forEach(e => {
e.classList.add("hidden")
})
})