-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
99 lines (99 loc) · 3.37 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
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
let courseBtns, masterPanels, mastersName;
window.onload = function()
{
courseBtns = document.getElementsByName("courseBtn");
masterPanels = document.getElementsByClassName("masters");
mastersName = document.getElementsByClassName("mastersName");
ClickCourse(2);
}
function ClickCourse(index)
{
let courses = [document.getElementById("course1"), document.getElementById("course2"), document.getElementById("course3")];
courseBtns[index].click();
courseBtns[index].style.background = "#000000";
courseBtns[index].style.color = "#ffffff";
courses[index].style.display = "block";
for(let i = 0; i < 3; i++)
{
if(i != index)
{
courseBtns[i].style.background = "#ffffff";
courseBtns[i].style.color = "#000000";
courses[i].style.display = "none";
}
}
}
function RightArrow(current_index)
{
let courseNr = document.getElementById("course_nr");
if(current_index == 3)
{
masterPanels[0].style.display = "inline-flex";
masterPanels[1].style.display = "none";
masterPanels[2].style.display = "none";
mastersName[0].style.display = "inline-flex";
mastersName[1].style.display = "none";
mastersName[2].style.display = "none";
current_index = 1;
}
else
{
if(current_index == 2)
{
masterPanels[0].style.display = "none";
masterPanels[1].style.display = "none";
masterPanels[2].style.display = "inline-flex";
mastersName[0].style.display = "none";
mastersName[1].style.display = "none";
mastersName[2].style.display = "inline-flex";
}
else
{
masterPanels[0].style.display = "none";
masterPanels[1].style.display = "inline-flex";
masterPanels[2].style.display = "none";
mastersName[0].style.display = "none";
mastersName[1].style.display = "inline-flex";
mastersName[2].style.display = "none";
}
current_index++;
}
courseNr.innerHTML = "Course " + String(current_index);
}
function LeftArrow(current_index)
{
let courseNr = document.getElementById("course_nr");
if(current_index == 1)
{
masterPanels[2].style.display = "inline-flex";
masterPanels[1].style.display = "none";
masterPanels[0].style.display = "none";
mastersName[2].style.display = "inline-flex";
mastersName[1].style.display = "none";
mastersName[0].style.display = "none";
current_index = 3;
}
else
{
if(current_index == 2)
{
masterPanels[2].style.display = "none";
masterPanels[1].style.display = "none";
masterPanels[0].style.display = "inline-flex";
mastersName[2].style.display = "none";
mastersName[1].style.display = "none";
mastersName[0].style.display = "inline-flex";
}
else
{
masterPanels[2].style.display = "none";
masterPanels[1].style.display = "inline-flex";
masterPanels[0].style.display = "none";
mastersName[2].style.display = "none";
mastersName[1].style.display = "inline-flex";
mastersName[0].style.display = "none";
}
current_index--;
}
courseNr.innerHTML = "Course " + String(current_index);
}