Hello,

A while ago i was looking for a simple, fast collapsible and expandable 
tree menu for quick navigation. Having looked at a large amount of scripts 
to do this my decision fell on the one below. 

But, it turned out that it was IE only.... (and uses the same ID for 
multiple objects).

Is there anyway of adapting the script to work with Mozilla and IE?
----
var head="display:''"
img1 = new Image()
img1.src = "fold.gif"
img2 = new Image()
img2.src = "open.gif"

function change()
{ 
    if(!document.all)
    return

    if (event.srcElement.id=="foldheader")
    {
        var srcIndex = event.srcElement.sourceIndex
        var nested = document.all[srcIndex + 1]

        if (nested.style.display=="none")  
        {
        nested.style.display='' 
        event.srcElement.style.listStyleImage="url(open.gif)"
        }

        else  
        {
            nested.style.display="none"
            event.srcElement.style.listStyleImage="url(fold.gif)"
        }
    }
}

document.onclick=change
----
in the body.. :
----
<ul>
  <li id="foldheader"><span class='LFrameCategoryTitle'>= General =</span>
  <ul id="foldinglist">
    <li type="square"><a href="#">Complaint</a>
    <li type="square"><a href="#">Suggestions</a>
    <li type="square"><a href="#">Schedule Appointment</a>
    <li type="square"><a href="#">Schedule Standby</a>
    <li type="square"><a href="#">Infomation</a>
  </ul>
</ul>
----

Reply via email to