-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
36 lines (32 loc) · 891 Bytes
/
Copy pathscript.js
File metadata and controls
36 lines (32 loc) · 891 Bytes
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
// JavaScript Document
// keeps page jump below header
// The function actually applying the offset
function offsetAnchor() {
if (location.hash.length !== 0) {
window.scrollTo(window.scrollX, window.scrollY - 150);
}
}
// This will capture hash changes while on the page
$(window).on("hashchange", function () {
offsetAnchor();
});
// This will toggle the bubble to be bigger or smaller
function makeBubbleBigger(s, s2){
bubble = document.getElementById(s);
pobj = document.getElementById(s2);
if (bubble.className.substring(0,6)=="bubble"){
if(s == "bubble1" || s == "bubble4"){
bubble.className="bigbubbleL";
} else {
bubble.className="bigbubbleR";
}
pobj.className="bigbubble-text";
} else {
bubble.className="bubble";
pobj.className="bubble-text";
}
}
// Let the page finish loading.
$(document).ready(function() {
offsetAnchor();
});