I have a drop down menu system that consists of many entries in two to
four levels. Because of the size and complexity of the menu, I have the
user hover over a menu list item to make its submenu visible.
This works fine, but I'd like to have this behavior also implemented
entirely from the keyboard. To do this I've enabled tabbing among text
strings by placing them into empty anchor elements. As a result, when I
tab to a list item text, it makes its submenu visible.
Here is an abbreviated and simplied markup to show what I mean:
<ul>
<li><a href="" id="a">Top Heading</a>
<ul id="list-a">
<li><a accesskey="a" href="<path>">a ) Subheading</a></li>
<li><a accesskey="b" href="<path>">b ) Subheading</a></li>
...
<style>
a#a:focus + ul#list-a, a#a:active + ul#list-a { display: block; }
</style>
When the user displays the submenu, he can click on it to navigate to
the <pathpage. However, I'd like to duplicate this operation from the
the keyboard. The traditional way was to use accesskey property (which
I've implemented in the example above by way of illustration). However,
using letters for access keys conflicts with browser hot keys, and not
all browsers (including my firefox/iceweasel) respond to digits.
Is there anything wrong with my way to make submenus visible above? Is
there any way to select and activate a menu that links to a page other
than getting there simply by tabbing, which is too cumbersome for a
large complex menu.
---
Haines Brown, KB1GRM
four levels. Because of the size and complexity of the menu, I have the
user hover over a menu list item to make its submenu visible.
This works fine, but I'd like to have this behavior also implemented
entirely from the keyboard. To do this I've enabled tabbing among text
strings by placing them into empty anchor elements. As a result, when I
tab to a list item text, it makes its submenu visible.
Here is an abbreviated and simplied markup to show what I mean:
<ul>
<li><a href="" id="a">Top Heading</a>
<ul id="list-a">
<li><a accesskey="a" href="<path>">a ) Subheading</a></li>
<li><a accesskey="b" href="<path>">b ) Subheading</a></li>
...
<style>
a#a:focus + ul#list-a, a#a:active + ul#list-a { display: block; }
</style>
When the user displays the submenu, he can click on it to navigate to
the <pathpage. However, I'd like to duplicate this operation from the
the keyboard. The traditional way was to use accesskey property (which
I've implemented in the example above by way of illustration). However,
using letters for access keys conflicts with browser hot keys, and not
all browsers (including my firefox/iceweasel) respond to digits.
Is there anything wrong with my way to make submenus visible above? Is
there any way to select and activate a menu that links to a page other
than getting there simply by tabbing, which is too cumbersome for a
large complex menu.
---
Haines Brown, KB1GRM
Comment