13.02.2013 Views

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Screen readers<br />

Testing this solution with screen readers reveals a problem. If we return false when hijacking the hrefs (a common practice<br />

to avoid the page “jumping” to the internal anchor/id that the href points to), then we leave the screen reader’s “cursor”<br />

where it is. While we move the related navigational pane to the top visually, we are not providing the same access to a<br />

screen reader. In fact, returning false removes functionality from the screen reader user—we’ve created a barrier by not<br />

allowing the in-page jump.<br />

How do we solve that problem? This is where we must examine accessibility and JavaScript again. If we had simply stopped<br />

at making sure that our pages were usable with scripting on or off, we wouldn’t have realized the problems we are creating<br />

for screen reader users. To reiterate, the scripting on/off scenario is more about basic interoperability than it is about accessibility<br />

for people with disabilities.<br />

One possibility is to not return false, and allow the history stack to take its course. In some cases, it may even be desirable<br />

to do so. However, this would mean that we get the visually jarring “jump” within the page and also end up hiding the main<br />

navigation, removing our toggle points from view. This solution is not particularly useful, and is likely to be annoying to users<br />

and unacceptable to the people who sign off on the solution.<br />

The other possibility is to return false, but use the href in the link and focus on that navigational pane. If we do this, we’ll<br />

allow screen reader users to continue reading in the correct place and ensure that we are not covering up our navigation or<br />

jumping all over the screen. This solution is implemented in the final files for this chapter.<br />

Another screen reader issue is the close link. This may be confusing to screen reader users. In their minds, they have simply<br />

moved to another part of the page, so why would they need to close anything? This link makes sense only to someone who<br />

is visually looking at the page. To attempt to solve this, we use a close icon (the typical x graphic), with alt text that says<br />

“return to main navigation,” with an appropriate href. Using the same strategy as applied for our main navigational links, we<br />

hijack the href to place the screen reader cursor in the next logical place.<br />

Keyboard-only use<br />

A keyboard-only user will experience many of the same issues as the screen reader user. In particular, placing the focus in<br />

the navigational pane will be critical to allowing a keyboard user to navigate properly.<br />

One solution that may gain popularity over time is the use of an invalid value for the tabindex attribute. Assigning a tabindex<br />

value of -1 to an element allows that element to receive the focus programmatically, but does not add it to the natural tab<br />

order of the document. This solution is a bit controversial because of the invalid value—by specification, HTML requires<br />

tabindex to be a number between 0 and 32767 (see www.w3.org/TR/REC-html40/interact/forms.html#adef-tabindex for<br />

details).<br />

Is the tabindex solution an acceptable one? IBM, Mozilla, and Microsoft all seem to think so, although representatives from<br />

IBM imply that they know this solution is not quite right (see www.csun.edu/cod/conf/2005/proceedings/2524.htm):<br />

Keep in mind that this is not yet part of any W3C or other official standard. At this time it is necessary to bend<br />

the rules in order to have full keyboard accessibility.<br />

chapter 10 Accessible Sliding Navigation<br />

259

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!