[thelist] javascript for expand/collapse list (aka tree view)

Tom Dell'Aringa pixelmech at yahoo.com
Tue Sep 16 09:12:20 CDT 2003


--- DESCHAMPS Stéphane DSI/SICOR
<stephane.deschamps at francetelecom.com> wrote:

> I tried many months ago to do the same (although my script was not
> as fine as yours ;-)) -- and then my clients asked for a +/- so
> that the text you use as an open/close control could feature a
> traditional link to this-or-that page.
> 
> So, for those who are looking for a variant, here's something that
> looks promising: http://inspire.server101.com/js/xc/
> It does quite the same as yours, while freeing the text from being
> a control. The +/- controls are added through DOM insert methods,
> thus it's quite configurable.

I played with the one on your main site with the +/- and it is quite
nice! Only looked at it in IE6 but it worked flawlessly, very well
done :) I'll have to look through that when I have some time..which
is probably never...

Tom

<tip type="javascript" author="pixelmech">
Many times when you are debugging a script you use alerts to give you
an idea of a variable value etc. Sometimes this can be quite
intrusive when you are going through a page over and over. In
particular, if you have an alert inside a loop - it can get to be
quite a pain.

What you can do is write that information out to the status line
instead.

window.status = myVarValue;

With the one caveat being that if you are writing more than one
thing, it gets overwritten with the next status write. However it can
be a very helpful debug tool. I had just worked on a drag and drop
application and it was very helpful to be able to drag items around
and watch the status bar give me updates on the progress.
</tip>

=====
http://www.pixelmech.com/ :: Web Development Services
http://www.DMXzone.com/ :: Premium Content Author / JavaScript / Every Friday!
http://www.maccaws.com/ :: Group Leader
[Making A Commercial Case for Adopting Web Standards]

"That's not art, that's just annoying." -- Squidward


More information about the thelist mailing list