-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
67 lines (58 loc) · 1.57 KB
/
main.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
$(document).ready(function () {
$("#ssk").click(function () {
$('html, body').animate({
scrollTop: $("#skills").offset().top
}, 1000);
});
});
$(document).ready(function () {
$("#sps").click(function () {
$('html, body').animate({
scrollTop: $("#school_projects").offset().top
}, 1000);
});
});
$(document).ready(function () {
$("#pps").click(function () {
$('html, body').animate({
scrollTop: $("#personal_projects").offset().top
}, 1000);
});
});
$(document).ready(function () {
$("#edu").click(function () {
$('html, body').animate({
scrollTop: $("#education").offset().top
}, 1000);
});
});
$(document).ready(function () {
$("#awd").click(function () {
$('html, body').animate({
scrollTop: $("#awards").offset().top
}, 1000);
});
});
$(document).ready(function () {
$("#xpr").click(function () {
$('html, body').animate({
scrollTop: $("#experience").offset().top
}, 1000);
});
});
window.onscroll = function () {
scrollFunction()
};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("scroll_top_btn").style.display = "block";
} else {
document.getElementById("scroll_top_btn").style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
$('html, body').animate({
scrollTop: 0
}, 1000);
}