0.1.0 • Published 8 years ago

toggle-aria v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

toggleAria

Little jQuery-Plugin for toggling WAI-ARIA states like aria-busy, aria-disabled, aria-expanded, and aria-hidden.

Imagine it as the counterpart to jQuery's toggleClass.

Just pass the state name as a parameter. Usage example for aria-expanded on a mobile menu trigger (why on the trigger? See here):

$("#nav__toggle").click(function(){

  $(this).toggleAria("expanded");

  $("#nav").toggleClass("nav--open");

});

See demo on CodePen (and use your browser's inspector on the button).