Using a hybrid of Mike Hall‘s hierarchical menus, I’ve come up with a rather nifty method to accessify them.
So, the method I’ve come up with is to create the menu using a tree of unordered lists, such as this:
I then add the below line at the head of the document, and add
class="magicmenuleft" to the root
That script searches for the
<ul> containing the magicmenu (left|right) class, and does some cool stuff to it.
The menu traverses the tree, replacing each level of the tree with a layer, in the manner that Mike Hall’s script understands.
That was, of course, very vexing.
The solution was to create an external array holding the variables. The index of the array was pretty handy – the index of the layer that the algorithm was writing to at the time.
Another difficulty arose when it was pointed out to me that the script fscked up in Opera and IE. I can’t test IE yet (don’t have it at home), but downloaded Opera and worked on that.
It turns out that Opera does not understand the
document.styleSheets collection, and all efforts to dynamically create document-wide styles failed. (the styles I’m talking about are the all-important positioning directives – I don’t mess with colours – leave that to the designers)
I ended up having to write the styles directly into each layer and link as I wrote it.
Long story short – I’m happy with it, and think it will make a formidibale tool. Must contact Mike and mention it to him.