Skip to content

Commit

Permalink
Do not expect 'include optional support' in example
Browse files Browse the repository at this point in the history
  • Loading branch information
Valerie Young authored and zcorpan committed Apr 19, 2021
1 parent 3f207ae commit 1a30872
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/disclosure/js/disclosureMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,21 @@ window.addEventListener(
});
}

// fake link behavior
var links = document.querySelectorAll('[href="#mythical-page-content"]');
var examplePageHeading = document.getElementById('mythical-page-heading');
for (var k = 0; k < links.length; k++) {
links[k].addEventListener('click', function (event) {
var pageTitle = event.target.innerText;
examplePageHeading.innerText = pageTitle;

// handle aria-current
for (var n = 0; n < links.length; n++) {
links[n].removeAttribute('aria-current');
}
});
}

// fake link behavior
disclosureMenus.forEach((disclosureNav, i) => {
var links = menus[i].querySelectorAll('[href="#mythical-page-content"]');
Expand Down

0 comments on commit 1a30872

Please sign in to comment.