13.02.2013 Views

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

WEB STANDARDS CREATIVITY

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

254<br />

// set the height to a new value<br />

thiselt.style.height = newHeight + "px";<br />

// if the height is now zero, we need to remove the "exposed" state<br />

// set the height back to the original height and clear the JS set<br />

// value for height so that it is reset to the value found in the<br />

// original CSS<br />

if (thiselt.offsetHeight == 0) {<br />

thiselt.className = thiselt.className.replace(/exposed/g,'');<br />

//force a repaint for getting around Safari rendering issue<br />

thiselt.innerHTML = thiselt.innerHTML + '';<br />

thiselt.style.height = '';<br />

}<br />

}<br />

function Reveal(elt, dH) {<br />

// prevent the function from doing anything if it is already active<br />

if (moving) return;<br />

var thiselt = document.getElementById(elt);<br />

if (/exposed/i.test(thiselt.className)) {<br />

// if we are exposed, we want to slide the pane up instead of down<br />

dH = -dH;<br />

// if we are sliding up, then we want to reset the overflow to hidden<br />

thiselt.style.overflow = "hidden";<br />

} else {<br />

// this opens the tab and respects classes that already exist<br />

thiselt.className += " exposed";<br />

}<br />

moving = true;<br />

// run the changeHeight function at the specified interval;<br />

// will run until we clear the interval<br />

revealTimer = setInterval("changeHeight('" + thiselt.id "','" + dH + "')", SLIDEINTERVAL);<br />

}<br />

Where does the accessibility come in to it?<br />

The core of this script is accessible because it is interoperable. That gives us the following benefits:<br />

It works with scripting on or off.<br />

It uses the core behaviors inherent to HTML, namely simple links to other spots on the same page.<br />

We are (generally speaking) changing the CSS only for components of the page, and we aren’t changing any CSS using<br />

display: none (which is notorious for removing elements from the internal DOM of a screen reader; see http://<br />

css-discuss.incutio.com/?page=ScreenreaderVisibility for a discussion of this often frustrating behavior).<br />

All links allow for keyboard activation. We didn’t do anything to enable that; it is built-in behavior. In our scripting,<br />

we made sure not to do anything that *takes away* keyboard functionality.<br />

This is good news, but it doesn’t mean that we are free and clear of further obligation. To make sure that this solution is<br />

really accessible, we need to do some additional testing. Let’s take a look at some of those tests.

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

Saved successfully!

Ooh no, something went wrong!