MORE REFACTORING!! + some improvements
Signed-off-by: ari melody <ari@arimelody.me>
This commit is contained in:
parent
151b2d8fd9
commit
cba791deba
17 changed files with 376 additions and 223 deletions
|
@ -2,11 +2,11 @@ const header_links = document.getElementById("header-links");
|
|||
const hamburger = document.getElementById("header-links-toggle");
|
||||
|
||||
document.addEventListener("click", event => {
|
||||
if (!header_links.contains(event.target) && !hamburger.contains(event.target) && !header_links.href) {
|
||||
header_links.classList.remove("open");
|
||||
}
|
||||
if (!header_links.contains(event.target) && !hamburger.contains(event.target) && !header_links.href) {
|
||||
header_links.classList.remove("open");
|
||||
}
|
||||
});
|
||||
|
||||
hamburger.addEventListener("click", event => {
|
||||
header_links.classList.toggle("open");
|
||||
hamburger.addEventListener("click", () => {
|
||||
header_links.classList.toggle("open");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue