-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
78 lines (71 loc) · 2.06 KB
/
script.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
var previousClass = null;
var prevObj = null;
function select(obj) {
if(prevObj != null && previousClass != null)
prevObj.className = previousClass;
if(prevObj != obj) {
prevObj = obj;
previousClass= obj.className;
obj.className = obj.className + " active";
} else {
obj.className = previousClass;
prevObj = null;
previousClass = null;
}
var parent = obj.parentElement;
var children = parent.children[4].children;
//Clear other active items
var changed = false;
var num = -1;
for(var i = 0; i < children.length; i++) {
if(parent.children[i]==obj)
num = i;
if(children[i].className=="active" && i != num) {
children[i].className="";
changed = true;
}
}
if(changed) {
setTimeout(function () {
if(children[num].className=="active") {
children[num].className="";
} else {
children[num].className="active";
}
}, 700);
} else {
if(children[num].className=="active") {
children[num].className="";
} else {
children[num].className="active";
}
}
}
window.onload = function () {
$("#body").css('position', 'absolute');
$("#body").css('top', '75px');
}
/*$(document).bind('mousewheel', function(e){
var delta = e.wheelDelta;
var inc = 85;
var topOfPage = 75;
if(delta < 0){
var bottom = $("#body").position().top + $("#body").height();
var top = $("#body").position().top;
if(bottom >= $(window).height()+20) {
if(bottom-inc < $(window).height()+20) {
$("#body").css('top', top-(bottom-$(window).height()+20) + "px");
} else
$("#body").css('top', (top-inc) + "px");
}
}
else{
var top = $("#body").position().top;
if(top <= topOfPage) {
if(top+inc > topOfPage)
$("#body").css('top', topOfPage + "px");
else
$("#body").css('top', (top+inc) + "px");
}
}
});*/