[thelist] javascript newbie need a hand

Gauthier@PlacidSound gauthier at placidsound.com
Tue May 28 12:49:01 CDT 2002


Thanks alot for this accurate support!

Your solution work quite right, there is many things that I've to
familiarize with, especially methods that return element(s) from the current
element
I'm just discovering the possiblities that a such API (DOM for instance)
allow, that's really amazing!

Can you say me if childNodes requires () or [] ?
Basically I will tempted to say that everything that return a collection
should use [] but I've saw () on MSDN...
if this is non standard, where can I find a such documentation that will
help my learning steps?

thanks for the precision.

Gauthier


> ----- Original Message -----
> From: "[Gauthier at PlacidSound]" <gauthier at placidsound.com>
> Sent: Tuesday, May 28, 2002 6:26 AM
>
>
[...]
> function toggleChilds(elm)
> {
>  for(var i=0; i<elm.childNodes.length; i++)
>  if(!elm.childNodes[i].length)
>    if (elm.childNodes[i].style.display=="")
>      elm.childNodes[i].style.display="none";
>    else
>      elm.childNodes[i].style.display="";
>   event.cancelBubble = true;
> }
>
> Call this function from your onclick handlers instead of hideChilds or
> showChilds.  Basically, this one determines the needed changed (hide or
> show) based on their current state.  There are a few other ways to
> accomplish this same functionality.  If you are curious, you could search
> for "expanding menu tutorial" on google and get enough links to answer
most
> of your foreseeable questions.
>
> HTH,
> -joshua





More information about the thelist mailing list