We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 43fef42 commit c7e3c0fCopy full SHA for c7e3c0f
1 file changed
markdown/assets/a11y-nav.js
@@ -0,0 +1,23 @@
1
+document.addEventListener("DOMContentLoaded", function () {
2
+
3
+ // Find sidebar navigation
4
+ const menuItems = document.querySelectorAll(".wy-menu-vertical li");
5
6
+ menuItems.forEach(item => {
7
+ const link = item.querySelector("a");
8
+ const submenu = item.querySelector("ul");
9
10
+ if (link && submenu) {
11
12
+ // Initial state
13
+ link.setAttribute("aria-expanded", item.classList.contains("current") ? "true" : "false");
14
15
+ link.addEventListener("click", function () {
16
+ const expanded = link.getAttribute("aria-expanded") === "true";
17
+ link.setAttribute("aria-expanded", expanded ? "false" : "true");
18
+ });
19
20
+ }
21
22
23
+});
0 commit comments