-
Notifications
You must be signed in to change notification settings - Fork 175
/
Copy pathCSDO1020.js
45 lines (33 loc) · 1.01 KB
/
CSDO1020.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
//Button
var mybutton = document.getElementById("myBtn");
window.onscroll = function() {
scrollFunction()
};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
mybutton.style.display = "block";
} else {
mybutton.style.display = "none";
}
}
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
//Prevent hash
$(document).ready(function(){
$('a').on('click', function(event) {
event.preventDefault();
var hash = this.hash;
$('html, body').animate({scrollTop: $(hash).offset().top}, 900);
});
})
//Get Hostname
document.getElementById("hostname").innerHTML= "<strong>Host </strong>" + location.hostname;
//Get DateTime
let date = new Date();
let options = {
weekday: "long", year: "numeric", month: "short",
day: "numeric", hour: "2-digit", minute: "2-digit"
};
document.getElementById("DateTime").innerHTML = date.toLocaleTimeString("en-us", options);