mirror of
https://github.com/helenclx/leilukin-site.git
synced 2025-04-05 06:52:42 +00:00
Enable using escape key to close navigation toggle
This commit is contained in:
parent
fb4515acc5
commit
a7c2bf8f29
@ -111,4 +111,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
navbarToggle.addEventListener("click", toggleNavigation);
|
navbarToggle.addEventListener("click", toggleNavigation);
|
||||||
|
|
||||||
|
window.addEventListener("keyup", (e) => {
|
||||||
|
if (e.key === "Escape") {
|
||||||
|
navbarToggle.focus();
|
||||||
|
closeNavigation();
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
Loading…
x
Reference in New Issue
Block a user