-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnavigation.js
71 lines (61 loc) · 1.79 KB
/
navigation.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
/*
* Alexander Conrad Nied's Homepage
* Navigation Javascript Routines
* Designed 2014-01-20, redesigned 2014-11-01
* Overhauled to JSQuery 2015-07-05
*/
// build and initialize some parts
$(document).ready(installNavigation);
$(window).load(normalizeIconHeights);
function installNavigation() {
//$(".iconlist div.row div")
// .addClass("project")
// .addClass("col-xs-6")
// .addClass("col-sm-4")
// .addClass("col-md-3");
$(".iconlist img")
.addClass("img-responsive")
.addClass("center-block");
// Load Modals
$('#modals').load('modals.html', function() {
$('#modals div.modal-body a').attr("target", "_blank");
});
}
function normalizeIconHeights() {
// equal_cols(".iconlist div.row div");
}
function equal_cols(el) {
var h = 0;
$(el).each(function(){
$(this).css({'height':'auto'});
if($(this).outerHeight() > h)
{
h = $(this).outerHeight();
}
$(this).css({'height':h});
});
}
function setResearchFocus(focus) {
// Set area to active
$('#research_navbar li.active').removeClass("active");
$('#research_navbar li.Res' + focus).addClass("active");
// Grow/Shrink research areas In/Out of focus
var turnOn = $('#projects .ResOff.Res' + focus);
var turnOff = $('#projects .Res:not(.ResOff):not(.Res' + focus + ')');
// Used to take 2000 ms
turnOn.animate({
padding: "15px",
opacity: 1.0,
fontSize: "1em",
width: "toggle"
}, 0000);
turnOff.animate({
padding: "0px",
opacity: 0.25,
fontSize: "0em",
width: "toggle"
}, 0000);
// Keep track of what was changed.
turnOn.addClass('ResOn').removeClass('ResOff');
turnOff.addClass('ResOff').removeClass('ResOn');
}