RE: collapsible hierarchical menu navigation javascript (accessible)

Your page still shows onclick attributes even if you don't have JavaScript
running. This is a bit messy. You could add the necessary JavaScript to the
elements on the page *after* the page has loaded and only if you can detect
that JavaScript is available.  See an example at
http://www.w3.org/International/geo/html-tech/outline/html-authoring-outline
.html 
 
If you look at the source you'll see no JavaScript in the table of contents.
It is written to the tree after loading. 
 
You can do this for more than just expanding tables of contents.  On the
page http://people.w3.org/rishida/family.html you will see no JavaScript
attached to the images that would normally change as you click on them,
because it is only added if JavaScript is available at load time. In fact,
the instructions for how to do this are only revealed if JavaScript is
available. Same would apply for buttons and other constructs that might be
used on a page to interact with JS features. In the case of the family page
I just change the styling, but on other pages there may be no button in the
source at all, but it is written to the tree if JS is available.
 
hth
RI
 


============
Richard Ishida
W3C

contact info:
http://www.w3.org/People/Ishida/

W3C Internationalization:
http://www.w3.org/International/



 


________________________________

	From: w3c-wai-gl-request@w3.org [mailto:w3c-wai-gl-request@w3.org]
On Behalf Of Fentress, Robert
	Sent: 06 July 2004 18:05
	To: w3c-wai-gl@w3.org
	Subject: collapsible hierarchical menu navigation javascript
(accessible)
	
	

	I've created a JavaScript navigation system and would appreciate any
feedback anyone might have about it and the techniques I've used to make it
accessible. A sample of it in action is at
http://courses.iddl.vt.edu/samplecourse/.  The JavaScript is at
http://courses.iddl.vt.edu/samplecourse/navigation.js.

	 

	I had trouble finding collapsible hierarchical menu navigation
scripts that degraded well when JavaScript was not present.  They all used
JavaScript to create the menu, which wasn't entirely kosher from an
accessibility perspective.  I wrote a script that works with the list markup
that is in a page already and thus users can access the navigation even if
JavaScript is turned off.  It doesn't have some of the bells and whistles of
the other scripts I've seen (though it has some unique coolness such as
automatic breadcrumbing and prev/next links) but it is small, simple,
DOM-based, and, I believe, accessible.  I've tried it out on WinXP with
Netscape 4.7 and 6.0 and higher, Mozilla 1.0, Opera 6.02, Phoenix 0.1, Mac
OS X with Safari 1.2.2, IE 5.2, Mozilla 1.5, Firebird 0.7, and Opera 6.03,
Mac OS 9.2.2 with IE 5.0, Opera 5.0, Netscape 4.77 and 6.0, and the latest
version of JAWS on WinXP.  The important functionality is available in all
those listed (keyboard access to all the links in the list markup) and the
other functionality is available in most of those listed.  The only real
duds are older versions of Opera and Netscape 4.7, though as I said, even
those allow access to the links.

	 

	Rob

	 

Received on Tuesday, 6 July 2004 13:51:04 UTC