[thelist] DHTML expanding lists

Jeff Lucido jlucido at version4.com
Mon Sep 2 17:02:01 CDT 2002


Evolters:

I have been banging my head around here for a few days working on what I
thought was a simple implementation of an expanding DHTML listing.
Specifically, the project I am working on requires a listing of data
with one level of data underneath. For example:

LINK 1
LINK 2
LINK 3
  link 3.1
  link 3.2
  link 3.3
LINK 4
  link 4.1
  link 4.2
  link 4.3
LINK5
LINK 6

The tricky part is this listing of data is contained within a table and
varies in vertical position based on the information needed for the page
(i.e. the number of elements above link 3 will vary from page to page).
Secondly, links 1,2,5,6 are not part of the expanding list, rather they
are regular links to other pages. So, basically if the visitor clicks on
link 3 the below main links (4,5,6) would move down accordingly based on
the amount of links contained under link 3, with the same being true for
link 4. The visitor would then see the exposed sub-links of 3.1,3.2,3.3.
I have tried several scripts form a few places (DHTMLCentral,
DynamicDrive, etc.) but they are all called using absolute positions and
require the setting of a container height for the possible amount of
space needed to display the items.

I hope I am making some sense here. All I really need it to do is when a
visitor clicks on a link which contains sub-links the main links below
it move down to accommodate the listing of sub-links. Also, when a
visitor "opens" a link (in the case number 3) and then opens another
link containing sub-links (in the case link 4) then the previously
opened one closes and the newly requested one opens. Nothing too hard,
right? Also, I do not care about persistence across clicks so when the
visitor returns to the page the proper link is still "open."

If any kind soul out there has run into this and can lend some support
in any form I would be greatly appreciative.

Thanks for the help!
-JSLucido



More information about the thelist mailing list