-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundle.js
41 lines (33 loc) · 1.36 KB
/
bundle.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
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {
document.getElementById("myBtn").style.display = "block";
} else {
document.getElementById("myBtn").style.display = "none";
}
}
$('#myBtn').on('click', function (e) {
e.preventDefault();
$('html,body').animate({
scrollTop: 0
}, 700);
});
var blogDate = document.getElementById("blog-date").innerHTML;
var oldDate = Date.parse(blogDate);
var date = new Date(oldDate).toLocaleDateString("en-US");
document.getElementById("blog-date").innerHTML = date;
function mobileFunction() {
var x = document.getElementById("myLinks");
var close = document.getElementById("mobile-close-icon");
var open = document.getElementById("mobile-open-icon");
if (x.style.display === "block") {
x.style.display = "none";
open.style.display = "block";
close.style.display = "none";
} else {
x.style.display = "block";
open.style.display = "none";
close.style.display = "block";
}
}