Navbar slide p3
Página 1 de 1.
Navbar slide p3
- Código:
// When the user scrolls down 20px from the top of the document, slide down the navbar
// When the user scrolls to the top of the page, slide up the navbar (50px out of the top view)
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("navbar").style.top = "0";
} else {
document.getElementById("navbar").style.top = "-50px";
}
}
Y esto es mi vida
Tori- Admin
- Mensajes : 19
Fecha de inscripción : 13/08/2017
Página 1 de 1.
Permisos de este foro:
No puedes responder a temas en este foro.
|
|