-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
36 lines (32 loc) · 1.03 KB
/
script.js
File metadata and controls
36 lines (32 loc) · 1.03 KB
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
var platformIndexAdjust = $("#Research").children().length - $(".platform").length - 1; // Adjustment to platform index
var sidebarDisplayTolerance = 30; // tolerance to decide to display sidebar or not
$(".platform").hover(
function() {
var windowWidth = $(window).width();
var sidebarWidth = $(".socials").width();
var platformPosition = $(this).position().left + $(this).width();
if (platformPosition > (windowWidth - sidebarWidth - sidebarDisplayTolerance)) {
sidebarDisplayFlag = 0;
toggleSidebarDisplay();
}
var platformIndex = $(this).index() - platformIndexAdjust;
$(".background").eq(platformIndex).css({
"opacity":"0.2"
});
$(".platformDescription").eq(platformIndex).css({
"opacity":"1"
});
}, function() {
if (sidebarDisplayFlag == 0) {
sidebarDisplayFlag = 1;
toggleSidebarDisplay();
}
var platformIndex = $(this).index() - platformIndexAdjust;
$(".background").eq(platformIndex).css({
"opacity":""
});
$(".platformDescription").eq(platformIndex).css({
"opacity":""
});
}
);