Manage nav button visibility
This commit is contained in:
parent
f9f3045fc4
commit
e228d09008
11
index.html
11
index.html
@ -44,6 +44,15 @@
|
|||||||
function closeNav() {
|
function closeNav() {
|
||||||
document.getElementById("mySidenav").style.width = "0";
|
document.getElementById("mySidenav").style.width = "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Manage navigation visibility */
|
||||||
|
var prevScrollpos = window.pageYOffset;
|
||||||
|
window.onscroll = function() {
|
||||||
|
var currentScrollpos = window.pageYOffset;
|
||||||
|
var visibility = (prevScrollpos > currentScrollpos) ? "visible" : "hidden";
|
||||||
|
document.getElementById("fixedbuttondiv").style.visibility = visibility;
|
||||||
|
prevScrollpos = currentScrollpos;
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@ -823,7 +832,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div id="fixedbuttondiv">
|
||||||
<a href="#head" onclick="openNav()">
|
<a href="#head" onclick="openNav()">
|
||||||
<img id="fixedbutton" src="files/menu.png" >
|
<img id="fixedbutton" src="files/menu.png" >
|
||||||
</a>
|
</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user