@n8d/htwoo-core
Version:
hTWOo is a Fluent Design Framework purely in HTML and CSS
2 lines (1 loc) • 551 B
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).htwoo=e.htwoo||{},e.htwoo.nav={}))}(this,(function(e){"use strict";const t=e=>{let t=e.target.closest(".hoo-navitem");"false"===t.getAttribute("aria-expanded")?t.setAttribute("aria-expanded",!0):t.setAttribute("aria-expanded",!1)};e.initMenu=()=>{document.querySelectorAll(".hoo-navitem[aria-expanded]").forEach((e=>{e.addEventListener("click",t)}))}}));