-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhideothers.js
39 lines (36 loc) · 1.19 KB
/
hideothers.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
38
39
document.querySelector("button.prvi").addEventListener("click", () => {
let elements = document.querySelectorAll(".grid-item");
for (let element of elements) {
element.style.visibility = "visible";
}
});
document.querySelector("button.drugi").addEventListener("click", () => {
let elements = document.querySelectorAll(".grid-item");
for (let element of elements) {
if (!element.classList.contains("logo-dizajn")) {
element.style.visibility = "hidden";
} else {
element.style.visibility = "visible";
}
}
});
document.querySelector("button.treci").addEventListener("click", () => {
let elements = document.querySelectorAll(".grid-item");
for (let element of elements) {
if (!element.classList.contains("web-dizajn")) {
element.style.visibility = "hidden";
} else {
element.style.visibility = "visible";
}
}
});
document.querySelector("button.cetvrti").addEventListener("click", () => {
let elements = document.querySelectorAll(".grid-item");
for (let element of elements) {
if (!element.classList.contains("development")) {
element.style.visibility = "hidden";
} else {
element.style.visibility = "visible";
}
}
});