-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathscript.js
More file actions
36 lines (29 loc) · 815 Bytes
/
script.js
File metadata and controls
36 lines (29 loc) · 815 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
33
34
var projects = document.querySelectorAll(".projects li");
var pen = document.querySelectorAll(".project-links p");
var links = document.querySelectorAll(".links");
function select()
{
this.classList.add("selected");
window.scroll({ top: 0, left: 0, behavior: "smooth" });
for(var j = 0; j < projects.length; j++)
{
if(projects[j] !== this)
{
projects[j].classList.remove("selected");
links[j].style.display = "none";
}
else
{
links[j].style.display = "block";
}
}
}
for(var i = 0; i < projects.length; i++)
{
projects[i].addEventListener("click", select);
}
for(var k = 0; k < pen.length; k++)
{
pen[k].setAttribute("data-height", "400");
pen[k].setAttribute("data-default-tab", "result");
}