-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscripts.js
More file actions
32 lines (26 loc) · 769 Bytes
/
Copy pathscripts.js
File metadata and controls
32 lines (26 loc) · 769 Bytes
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
var tabs = document.querySelectorAll(".lboard_tabs ul li");
var today = document.querySelector(".today");
var month = document.querySelector(".month");
var year = document.querySelector(".year");
var items = document.querySelectorAll(".lboard_item");
tabs.forEach(function(tab){
tab.addEventListener("click", function(){
var currenttab = tab.getAttribute("data-li");
tabs.forEach(function(tab){
tab.classList.remove("active");
})
tab.classList.add("active");
items.forEach(function(item){
item.style.display = "none";
})
if(currenttab == "today"){
today.style.display = "block";
}
else if(currenttab == "month"){
month.style.display = "block";
}
else{
year.style.display = "block";
}
})
})