minimize and scroll on navigation

This commit is contained in:
2022-05-23 18:06:32 -04:00
parent f0e4f98981
commit 95a0fc5064

View File

@@ -3,6 +3,12 @@ function onLoaded() {
console.log("loaded trigger");
document.body.scrollTop = 0; // For Safari
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
let navs = document.querySelectorAll('.navElement');
navs.forEach(function (element) {
element.onclick = function () {
toggleMenu();
}
});
window.onresize = function () { resizer() };
resizer();
@@ -45,6 +51,7 @@ function scrollFunction() {
}
export function toggleMenu() {
if (window.innerWidth < 1200) {
const e = document.querySelector(".navControl");
const bar = document.querySelector(".header");
if (e.style.maxHeight === '0px') {
@@ -55,3 +62,4 @@ export function toggleMenu() {
bar.style.borderBottomWidth = '3px';
}
}
}