I would like to use a drop-down menu on a web site that I'm working on, but have a question about usability/accessibility as well as whether or not it will cause issues on being read/indexed by the search engines.
The menu listed above uses the setting of display: none; initially, then changes that setting to display: block; via jQuery. My concern is that it will make the menu unreadable to screen readers causing usability issues, plus I'm concerned that the navigation will not be indexed by the search engines causing another set of problems.
Indexing is done on page content to a much greater extent than what your menus might say.
As far as I know, which is little, in the area of screen readers is that they are reading the HTML not exactly what is on the screen. Therefore, using that logic, they will read the menu items even though, at the moment, they are not visible on the screen.
As far as I know, most screenreaders "read" the DOM, not the HTML. Also, they do take into account many "visual" commands, such as visibility: hidden and display: none. This does give authors more control, but also means you have to differentiate between things you want hidden, and things you want visible to the screenreaders but hidden visually.
@Odd_E: Are you sure visibility: hidden is treated any differently from display: none by the screenreaders?
These make the element "disappear" and "appear" - however, they do not remove the size of the element from the DOM. So if you had a box of 100x100 it would leave a gap. display:none; get's rid of it completely.
Always use visibility:hidden in conjunction with display: none; for screen readers and the desired effect of removing it from view.
Thanks to everyone for the recommendations. I've decided to do some additional research to familiarize myself with the use of "visibility" and redesign accordingly.
I would like to use a drop-down menu on a web site that I'm working on, but have a question about usability/accessibility as well as whether or not it will cause issues on being read/indexed by the search engines.
Here is the basic menu: myMenu.html.
Here is the article that raised my concern: Places It’s Tempting To Use Display: None; But Don’t
The menu listed above uses the setting of display: none; initially, then changes that setting to display: block; via jQuery. My concern is that it will make the menu unreadable to screen readers causing usability issues, plus I'm concerned that the navigation will not be indexed by the search engines causing another set of problems.
JS used:
jquery-1.7.1.min.js
jquery.dropmenu-1.1.4.js
Any input on how to adjust this menu, or another method to use?
visibility: hidden;. It's very easy to do without JS.As far as I know, which is little, in the area of screen readers is that they are reading the HTML not exactly what is on the screen. Therefore, using that logic, they will read the menu items even though, at the moment, they are not visible on the screen.
Happy to be corrected.
visibility: hiddenanddisplay: none. This does give authors more control, but also means you have to differentiate between things you want hidden, and things you want visible to the screenreaders but hidden visually.@Odd_E: Are you sure
visibility: hiddenis treated any differently fromdisplay: noneby the screenreaders?visibility:visible;
These make the element "disappear" and "appear" - however, they do not remove the size of the element from the DOM. So if you had a box of 100x100 it would leave a gap. display:none; get's rid of it completely.
Always use visibility:hidden in conjunction with display: none; for screen readers and the desired effect of removing it from view.
Thanks for all the help.