dopdown added eventlistener
This commit is contained in:
@@ -66,6 +66,14 @@ async function loadData() {
|
|||||||
const sidebar_top = document.getElementById("sidebar-top-content");
|
const sidebar_top = document.getElementById("sidebar-top-content");
|
||||||
|
|
||||||
const navbar_mobile = document.getElementById("navbar-mobile");
|
const navbar_mobile = document.getElementById("navbar-mobile");
|
||||||
|
const button_mobile2 = document.getElementById("button_mobile");
|
||||||
|
|
||||||
|
document.addEventListener("click", (e) => {
|
||||||
|
if (!e.target.closest("navbar-mobile") && button_mobile2.classList.contains("inactive")) {
|
||||||
|
navbar_mobile.classList.add("inactive");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const navbar_mobile_links = document.getElementById("navbar-mobile-links");
|
const navbar_mobile_links = document.getElementById("navbar-mobile-links");
|
||||||
const button_navbar_mobile = document.createElement("button");
|
const button_navbar_mobile = document.createElement("button");
|
||||||
const button_mobile = document.getElementById("button-mobile");
|
const button_mobile = document.getElementById("button-mobile");
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
--serif: Georgia, serif;
|
--serif: Georgia, serif;
|
||||||
--sans: system-ui, sans-serif;
|
--sans: system-ui, sans-serif;
|
||||||
--nav-w: 230px;
|
--nav-w: 230px;
|
||||||
--nav-mobile-w: 100px;
|
--nav-mobile-w: 200px;
|
||||||
--font-size: 1rem;
|
--font-size: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user