-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathevents.js
104 lines (89 loc) · 3.74 KB
/
events.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
100
101
102
103
// nar bar
var a = 1;
var r = 0;
var e = 0;
var c = 0;
function changeAboutColor() {
a = 1;
r = 0;
e = 0;
c = 0;
document.getElementById('pills-about-tab').style.color = "white";
document.getElementById('pills-resources-tab').style.color = "#FF7D7D";
document.getElementById('pills-events-tab').style.color = "#FF7D7D";
document.getElementById('pills-contact-tab').style.color = "#FF7D7D";
}
function changeResourcesColor() {
a = 0;
r = 1;
e = 0;
c = 0;
document.getElementById('pills-about-tab').style.color = "#FF7D7D";
document.getElementById('pills-resources-tab').style.color = "white";
document.getElementById('pills-events-tab').style.color = "#FF7D7D";
document.getElementById('pills-contact-tab').style.color = "#FF7D7D";
}
function changeEventsColor(){
a = 0;
r = 0;
e = 1;
c = 0;
document.getElementById('pills-about-tab').style.color = "#FF7D7D";
document.getElementById('pills-resources-tab').style.color = "#FF7D7D";
document.getElementById('pills-events-tab').style.color = "white";
document.getElementById('pills-contact-tab').style.color = "#FF7D7D";
}
function changeContactColor(){
a = 0;
r = 0;
e = 0;
c = 1;
document.getElementById('pills-about-tab').style.color = "#FF7D7D";
document.getElementById('pills-resources-tab').style.color = "#FF7D7D";
document.getElementById('pills-events-tab').style.color = "#FF7D7D";
document.getElementById('pills-contact-tab').style.color = "white";
}
$(document).click(function(){
if (a == 1){
document.getElementById('pills-about-tab').style.backgroundColor = "#FF7D7D";
document.getElementById('pills-resources-tab').style.backgroundColor = "#FFCCCC";
document.getElementById('pills-events-tab').style.backgroundColor = "#FFCCCC";
document.getElementById('pills-contact-tab').style.backgroundColor = "#FFCCCC";
}else if (r == 1){
document.getElementById('pills-about-tab').style.backgroundColor = "#FFCCCC";
document.getElementById('pills-resources-tab').style.backgroundColor = "#FF7D7D";
document.getElementById('pills-events-tab').style.backgroundColor = "#FFCCCC";
document.getElementById('pills-contact-tab').style.backgroundColor = "#FFCCCC";
}else if (e == 1){
document.getElementById('pills-about-tab').style.backgroundColor = "#FFCCCC";
document.getElementById('pills-resources-tab').style.backgroundColor = "#FFCCCC";
document.getElementById('pills-events-tab').style.backgroundColor = "#FF7D7D";
document.getElementById('pills-contact-tab').style.backgroundColor = "#FFCCCC";
}else {
document.getElementById('pills-about-tab').style.backgroundColor = "#FFCCCC";
document.getElementById('pills-resources-tab').style.backgroundColor = "#FFCCCC";
document.getElementById('pills-events-tab').style.backgroundColor = "#FFCCCC";;
document.getElementById('pills-contact-tab').style.backgroundColor = "#FF7D7D";
}
});
$(document).ready(function () {
document.getElementById('pills-about-tab').style.color = "white";
document.getElementById('pills-about-tab').style.backgroundColor = "#FF7D7D";
document.getElementById('pills-resources-tab').style.backgroundColor = "#FFCCCC";
document.getElementById('pills-events-tab').style.backgroundColor = "#FFCCCC";
document.getElementById('pills-contact-tab').style.backgroundColor = "#FFCCCC";
});
// When the user scrolls the page, execute myFunction
window.onscroll = function() {myFunction()};
// Get the navbar
var navbar = document.getElementById("navbar");
// Get the offset position of the navbar
var sticky = navbar.offsetTop;
// Add the sticky class to the navbar when you reach its scroll position. Remove "sticky" when you leave the scroll position
function myFunction() {
if (window.pageYOffset >= sticky) {
navbar.classList.add("sticky")
} else {
navbar.classList.remove("sticky");
}
}