generated from JelilFaisalAbudu/readme-template-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
13 lines (12 loc) · 594 Bytes
/
main.js
File metadata and controls
13 lines (12 loc) · 594 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
// When the user scrolls down 80px from the top of the document, resize the navbar's padding and the logo's font size
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 80 || document.documentElement.scrollTop > 80) {
document.getElementById("main").style.display= "none";
document.getElementById("logo").style.fontSize = "";
document.getElementById("logo").style.fontSize = "";
} else {
document.getElementById("navbar").style.padding = "80px 10px";
document.getElementById("logo").style.fontSize = "35px";
}
}