Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A possible implementation would be:</p> <p><strong>HTML structure:</strong></p> <pre class="lang-html prettyprint-override"><code>&lt;div&gt; &lt;!-- Outer wrapper --&gt; &lt;ul&gt; &lt;!-- Main navigation bar container --&gt; &lt;li&gt; &lt;!-- First-level item without submenu --&gt; &lt;a&gt; &lt;!-- Destination URL --&gt; &lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;!-- First-level item with submenu --&gt; &lt;a&gt; &lt;!-- Destination URL --&gt; &lt;/a&gt; &lt;ul&gt; &lt;!-- Second-level menu container --&gt; &lt;li&gt; &lt;!-- Second-level item --&gt; &lt;a&gt; &lt;/a&gt; &lt;!-- Destination URL --&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p><strong>Roles:</strong></p> <ul> <li>role=”navigation” for outer wrapper <code>&lt;div&gt;</code></li> <li>role="menubar" for <code>&lt;ul&gt;</code> navigation bar container</li> <li>role="menu" for second-level <code>&lt;ul&gt;</code> containers</li> <li>role="presentation" for first- and second-level <code>&lt;li&gt;</code> menu items (they are not needed in the exposed accessible menubar structure)</li> <li>role="menuitem" for first- and second-level <code>&lt;a&gt;</code> menu items</li> </ul> <p><strong>Properties:</strong></p> <ul> <li>aria-haspopup="true" for first-level <code>&lt;a&gt;</code> menu items having a submenu</li> <li>aria-labelledby="ID of previous <code>&lt;a&gt;</code> menu item" for second-level <code>&lt;ul&gt;</code> containers</li> </ul> <p><strong>States:</strong></p> <ul> <li>aria-selected="true" on currently visited first- or second-level <code>&lt;a&gt;</code> item; aria-selected="false" on the other <code>&lt;a&gt;</code> items. That is to enforce the concept “selected &lt;==> current page”</li> <li>aria-expanded="true/false" for second-level <code>&lt;ul&gt;</code> containers</li> <li>aria-hidden="true/false" for second-level <code>&lt;ul&gt;</code> containers</li> <li>aria-activedescendant="" for main <code>&lt;ul&gt;</code> navigation bar container. This is an alternative to working with tabindex</li> <li>tabindex=0 on currently visited <code>&lt;a&gt;</code> item; tabindex=-1 on the other <code>&lt;a&gt;</code> items. That is in order to first focus on the current page when tabbing to the navigation bar. It is an alternative to working with aria-activedescendant</li> </ul> <p><strong>Keyboard:</strong></p> <ul> <li>Tab: Move focus in/out of the menu from other points in the web application.</li> <li>Shift+Tab: Move focus in/out of the menu from other points in the web application, in the reversed order.</li> <li>Right arrow: Next navigation bar item</li> <li>Left arrow: Previous navigation bar item</li> <li>Enter: Activate currently focused item (i.e. navigate to corresponding URL)</li> <li>Space: Activate currently focused item (i.e. navigate to corresponding URL)</li> </ul> <p><strong>Aug/2014: aria-selected Vs menuitem</strong></p> <p>In reply to @Joshua Muheim comment: now I can see <a href="http://www.w3.org/TR/wai-aria/roles#menuitemradio" rel="noreferrer">from here</a>, as well as from <a href="http://www.w3.org/TR/wai-aria/states_and_properties#aria-selected" rel="noreferrer">his reference</a>, that <code>aria-selected</code> attribute is not allowed for <code>menuitem</code> role.<br> As I read from this recent <a href="https://stackoverflow.com/a/24798883/540776">SO answer</a> there are some solutions given the current state of things, and there is a new proposed attribute too.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload