as days pass by (original) (raw)

ignore

Unobtrusive DHTML, and the power of unordered lists

In recent months, we've seen people begin to take advantage of the fact that nested unordered lists (that's

`

Note that you do not need to change the class of any of the internal ULs, only the top-level one.

Note also that you need valid markup for this. To be specific, you must ensure that a UL contains only LIs and nothing else. For aqdd to work properly, you should then ensure that an LI contains either:

That's all you need to do to have that nested list structure converted to a dropdown list.

Explorer trees with aqtree3

You set up aqtree3 in almost exactly the same way as aqdd, above; just a couple of filename changes are needed. First, add lines for Javascript and stylesheet:

<script src="<aqtree3.js>" type="text/javascript"></script>

<link rel="stylesheet" href="<aqtree3.css>">

Grab the files:

And add the class name aqtree3 to the ULs that you want to be displayed as explorer trees.

Better explorer trees with aqtree3clickable

You set up aqtree3clickable identically to aqtree3. First, add lines for Javascript and stylesheet:

<script src="<aqtree3clickable.js>" type="text/javascript"></script>

<link rel="stylesheet" href="<aqtree3clickable.css>">

Grab the files:

And add the class name aqtree3clickable to the ULs that you want to be displayed as explorer trees.

There you have it. Unobtrusive but effective DHTML.

Update (09-04-2003): minor change by Albert de Klein to fix a bug.

Update (18-09-2003): Added aqtree3clickable.

Update (24-12-2003): Allow setting of aq3open class on LIs in aqtree3clickable to have some branches expanded by default.

Update (01-08-2005): Fix bug in aqtree3clickable.css regarding indents, thanks to bug report from Adam J. Sontag

Updated (2006-01-13): use the corrected addEvent function.

Stuart Langridge, November 2002

kryogenix.org | other browser experiments