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() {
|
||||
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>
|
||||
</head>
|
||||
|
||||
@ -823,7 +832,7 @@
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<div>
|
||||
<div id="fixedbuttondiv">
|
||||
<a href="#head" onclick="openNav()">
|
||||
<img id="fixedbutton" src="files/menu.png" >
|
||||
</a>
|
||||
|
Loading…
Reference in New Issue
Block a user