Merge branch 'dudosing' into andrei
# Conflicts: # templates/main.html
This commit is contained in:
commit
d5abf412f2
18
static/js/Scroll.js
Normal file
18
static/js/Scroll.js
Normal 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";
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user