Skip to content

Commit

Permalink
improve accessibility to support more/less buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
zdeveloper committed Sep 6, 2023
1 parent cad3fa1 commit 975763e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pages/support.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ <h2>Get in touch</h2>
});
const toggleHiddenLinks = (footerElement) => {
const footerText = footerElement.querySelector('.footer-text');
const toggleButton = footerElement.querySelector("button");
const cardElement = footerElement.parentElement;
const bodyElement = cardElement.querySelector('.usa-card__body');
const hiddenLinks = cardElement.querySelectorAll('.hidden-link');
Expand All @@ -197,10 +198,14 @@ <h2>Get in touch</h2>
bodyElement.classList.add('expanded');
animateCSS(link, 'fadeInDown');
footerText.textContent = 'Less';
footerText.setAttribute("aria-label", "see less helpful links")
toggleButton.setAttribute("aria-expanded", true)
} else {
animateCSS(link, 'fadeOutUp');
bodyElement.classList.remove('expanded');
footerText.textContent = 'More';
footerText.setAttribute("aria-label", "see more helpful links")
toggleButton.setAttribute("aria-expanded", false)
}
});
}
Expand Down

0 comments on commit 975763e

Please sign in to comment.