css - Accessibility of Hamburger Menu? -


i working on making responsive website accessible , wonder whether blind person opens page on smartphone able open hidden menu somehow, or if he/she "sees" anyway - read screen reader?

my "hamburger menu" has structure this:

<div class="menu-icon">click here open or close menu</div> <nav id="navigation" role="navigation" tabindex="0" >     <ul>        <li><a href="...">...</a></li>        <li><a href="...">...</a></li>        <li><a href="...">...</a></li>        <li><a href="...">...</a></li>        <li><a href="...">...</a></li>     </ul> </nav> 

the related css follows (first general rules, media queries mobile):

.menu-icon {   display: none; } nav {   display: block; } @media screen , (max-width: 850px) {   .menu-icon {     display: block;     position: absolute;     right: 15px;     top: 10px;     z-index: 2;     width: 32px;     height: 32px;     background-image: url(images/menu-icon.png);     background-size: 100% auto;     background-position: 0px 0px;     text-indent: -5000px;   }      nav {     display: none;   } } 

and here's relevant jquery:

jquery('.menu-icon').on('click', function () {   jquery('nav').slidetoggle(300); }); 

all works expected, wondering how mobile device activated screen reader present user , let him/her control it:

  • will he/she able "click" .menu-icon div somehow ge access menu?

    if not, following css (which follows after media queries mobile) make menu "visible" screenreader same way on desktop screen?:

-

@media speech {   .menu-icon {     display: none;   }   nav {     display: block !important;   } } 

i know "just try it", it's hard test if not used handle screenreader on regular basis, on mobile (plus every screenreader acts bit different...). mobile simulation mode in browser tools (on desktop) doesn't here...

a solution include visually hidden text 'open menu' in element triggering open (usually a tag), , add attribute role="button" trigger. a tag href anchor nav id.

<a href="#nav" role="button" class="js_open_trigger">open menu</a> <nav id="nav">......</nav> 

then need media queries show/hide desktop or mobile parts.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -