If you want each switch content header to be accessible via keyboard, you can use HTML's tabindex attribute, along with a little bit of JavaScript to make the header respond to keyboard events. So, first give each header a "tabindex" attribute with value "0", for example:
Code:
<h3 id="bobcontent1-title" class="handcursor" tabindex="0"> What is JavaScript?</h3>
In your CSS, I recommend highlighting the tabbed header with a border, using:
Code:
<style type="text/css">
.handcursor:focus{
border: 1px dashed black;
}
</style>
Then, inside switchcontent.js, find and add to the below line:
Code:
this.headers[i].onclick=function(){instanceOf.toggledisplay(this)}
this.headers[i].onkeypress=function(){instanceOf.toggledisplay(this)}
The code in red is new. That should do it. You can now tab to each header, and press a key (such as "Enter") to expand/ contract it.
Bookmarks