[thelist] collapsible elements without using IDs

Matt Warden mwarden at gmail.com
Fri Dec 10 14:03:47 CST 2004

Hi Christian,

On Fri, 10 Dec 2004 20:01:14 +0000, Christian Heilmann
<lists at onlinetools.org> wrote:
> The only thing that is not OK is to collapse elements via CSS only, for
> the mere reason that users might  not have javascript enabled and will
> thus be never able to  expand those.

Well, that is why the initial class is a "dummy" class called
"collapsible." (or "expandable" -- they both do nothing but mark divs
I want this functionality for). This does not collapse these elements.
The only way the element will become collapsed is if javascript is
enabled, because it is initCollapsibleDivs() (or whatever I called it)
that actually sets the initial collapsed or expanded state.

> I  seem to remember your example being rather complex, if you could tell
> me exactly what you need to  do, I could create a simple one,
> Am I  right to assume that you need a script that loops through  all
> elements and checks if they have the class collapsible. Then you want to
> create a link preceeding them which expands and collapses them?

Yes. And I need it to be as general as possible because I want the
functionality regardless of how many divs on the page need to be
collapsible/expandable. This is the reason I am looping through all
divs on the page looking for the 'collapsible' or 'expandable' class

After explaining that the collapsible/expandable classes will do
nothing for the javascript-disabled user (and thus be expanded by
default), does my solution follow this standard?

Thanks again for all your help,

Matt Warden
Miami University
Oxford, OH

This email proudly and graciously contributes to entropy.

More information about the thelist mailing list