Plume/static/js/menu.js
2018-09-01 16:11:42 +02:00

10 lines
350 B
JavaScript

document.addEventListener("DOMContentLoaded", () => {
let content = document.getElementById("content");
document.getElementById("menu").querySelector("a").addEventListener("click", () => {
content.classList.add("opened");
});
content.addEventListener("click", (e) => {
if (e.target === content)
content.classList.remove("opened");
});
});