-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscroll.js
113 lines (98 loc) · 2.98 KB
/
scroll.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
104
105
106
107
108
109
110
111
112
113
// Only enable scrollify if screen has sufficient landscape width
// Otherwise page scrolling gets messed up when going from 2x2 to single column
if ($(window).width() / $(window).height() > 3/2) {
$.scrollify({
section: ".scroll"
});
}
var i = 0;
var buttons = ["#landing-page-button", "#intro-button", "#top-tech-button",
"#salary-button", "#gender-diff-button", "#kids-button",
"#majors-button", "#degrees-button", "#conclusion-button",
"#sources-button"];
var selected = buttons[0];
var yellow = "#FCC800";
var blue = "#1d3b6b";
var lastScrollTop = 0;
$(selected).css("background", yellow);
$("button").mouseover(function() {
$(this).css("background", yellow);
$("#" + this.id + "-text").css("opacity", 1);
});
$("button").mouseout(function() {
if ("#" + this.id != selected) {
$(this).css("background", blue);
}
$("#" + this.id + "-text").css("opacity", 0);
});
$('#landing-page-button').click(function() {
$.scrollify.move('#1');
$(selected).css("background", blue);
selected = '#landing-page-button';
$(selected).css("background", yellow);
i = 0;
});
$('#intro-button').click(function() {
$.scrollify.move('#2');
$(selected).css("background", blue);
selected = '#intro-button';
$(selected).css("background", yellow);
i = 1;
});
$('#top-tech-button').click(function() {
$.scrollify.move('#3');
$(selected).css("background", blue);
selected = '#top-tech-button';
$(selected).css("background", yellow);
i = 2;
});
$('#salary-button').click(function() {
$.scrollify.move('#4');
$(selected).css("background", blue);
selected = '#salary-button';
$(selected).css("background", yellow);
i = 3;
});
$('#gender-diff-button').click(function() {
$.scrollify.move('#5');
$(selected).css("background", blue);
selected = '#gender-diff-button';
$(selected).css("background", yellow);
i = 4;
});
$('#kids-button').click(function() {
$.scrollify.move('#6');
$(selected).css("background", blue);
selected = '#kids-button';
$(selected).css("background", yellow);
i = 5;
});
$('#majors-button').click(function() {
$.scrollify.move('#7');
$(selected).css("background", blue);
selected = '#majors-button';
$(selected).css("background", yellow);
i = 6;
});
$('#degrees-button').click(function() {
$.scrollify.move('#8');
$(selected).css("background", blue);
selected = '#degrees-button';
$(selected).css("background", yellow);
i = 7;
});
$('#conclusion-button').click(function() {
$.scrollify.move('#9');
$(selected).css("background", blue);
selected = '#conclusion-button';
$(selected).css("background", yellow);
i = 8;
});
$('#sources-button').click(function() {
$.scrollify.move('#10');
$(selected).css("background", blue);
selected = '#sources-button';
$(selected).css("background", yellow);
$(seclected + ":hover").css("background", blue);
i = 9;
});