Merge branch 'dudosing' into andrei

# Conflicts:
#	templates/main.html
This commit is contained in:
Андрей Дувакин 2022-12-17 11:30:27 +05:00
commit d5abf412f2
2 changed files with 135 additions and 117 deletions

18
static/js/Scroll.js Normal file
View File

@ -0,0 +1,18 @@
var prevScrollpos = window.pageYOffset;
window.onload = function()
{
document.getElementById("navbar").style.display = "none";
}
window.onscroll = function() {
var currentScrollPos = window.pageYOffset;
// 20 is an arbitrary number here, just to make you think if you need the prevScrollpos variable:
if (currentScrollPos > 1250) {
// I am using 'display' instead of 'top':
document.getElementById("navbar").style.display = "initial";
}
else {
document.getElementById("navbar").style.display = "none";
}
}