How to hide/show top-navbar? #4
Unanswered
Line4GitHub
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
/*
When the user scrolls down, hide the top-navbar.
When the user scrolls up, show the top-navbar.
*/
---My main.js ----------------
var prevScrollpos = window.pageYOffset;
window.onscroll = function() {
var currentScrollPos = window.pageYOffset;
if (prevScrollpos > currentScrollPos) {
document.getElementById("top-navbar").style. Topp = "0";
} else {
document.getElementById("top-navbar").style. Topp = "-40px";
}
prevScrollpos = currentScrollPos;
}
---My main.css ---------------
.top-navbar
{
position: fixed;
top: 0;
padding: 0 40px;
height: 40px;
width: 100%;
display: block;
background-color: #bbffff;
}
not work !
if remove
from
\templates\singulinkfx\partials\head.tmpl.partial
or if remove
overflow: hidden;
position: absolute;
from
html, body
{
/*
overflow: hidden;
position: absolute;
*/
}
in discord.css
it's work!
Beta Was this translation helpful? Give feedback.
All reactions