Click to See Complete Forum and Search --> : A little help with an Expandable Text Menu


bkornman
03-18-2003, 08:59 PM
Im having a little trouble with a javascript action i was hoping someone here would be kind enough to help me with.

Im utilizing the following script in my page:

<script language="javascript">
<!--

function change() {
if(!document.all)
return
if (event.srcElement.className=="expandable"){
var x=event.srcElement.parentElement
if (x.all[2].style.display=="none"){
x.all[2].style.display='';
}
else {
x.all[2].style.display="none"
}
}
if (event.srcElement.className=="expandable2"){
var x=event.srcElement.parentElement
if (x.all[2].style.display=="none"){
x.all[2].style.display='';
}
else {
x.all[2].style.display="none"
}
}
}
document.onclick=change

function MM_displayStatusMsg(msgStr) { //v1.0
status=msgStr;
document.MM_returnValue = true;
}
//-->
</SCRIPT>

What i have been trying to do, with no avail, is change the script so the default action for the menus is expanded, and when you click they contract. If anyone out there could possibly help me with this, i would be indebted to you.

Thanks,
BRK

AdamBrill
03-18-2003, 10:20 PM
Could you post the rest of you code? The code you posted is just the javascript part, so it doesn't do anything... Thanks. ;)

bkornman
03-22-2003, 03:07 PM
Thanks for the note, sorry about my stupidity. Here is the rest of the code.

<BODY bgcolor="122222">
<table width="100%" border="0" cellspacing="0" cellpadding="1" rules="rows">
<tr>
<td class="mainsection"><a href="#" class="folding" style="color:white" onMouseOver="MM_displayStatusMsg('View a List of ILC\'s Current Projects');return document.MM_returnValue">Current Projects</a><br>
<p class="subsection" style="display:none"> <br><a href="CAS.htm" style="color:white" target="mainFrame">Campbell
Airstrip Runway Rehab</a> <br>
<br>
<a href="CS.htm" style="color:white" target="mainFrame">Kwethluk Power Line Extension</a> <br>
<br>
<a href="CS.htm" style="color:white"target="mainFrame">Bureau of Land Management Survey</a> <br>
<br>
<a href="BMCS.htm" style="color:white" target="mainFrame">Big Mountain Clean Sweep Phase 1</a> </p>
<table width="100%" border="0" cellspacing="0" cellpadding="1" rules="rows">
<tr>
<td class="mainsection"><a href="#" class="expandable" style="color:white" onMouseOver="MM_displayStatusMsg('View a List of ILC\'s Past Projects');return document.MM_returnValue">Past
Projects</a><br> <p class="subsection" style="display:none"> <br>
<a href="BIA1.htm" target="mainFrame" style="color:white">BIA Road
Phase 1 - Igiugig, AK</a> <br>
<br>
<a href="BIA2.htm" style="color:white" target="mainFrame">BIA
Road Phase 2 - Igiugig, AK</a> <br>
<a href="IggPlu.htm" style="color:white" target="mainFrame"><br>
Igiugig
Power Line Extension</a> <br>
<br>
<a href="BFF.htm" style="color:white" target="mainFrame">Lake
and Peninsula School District: Bulk Fuel Farms</a> <br>
<br>
<a href="LF.htm" style="color:white" target="mainFrame">Igiugig
Municipal Landfill</a> <br>
<br>
<a href="FAA1.htm" style="color:white" target="mainFrame">FAA
Soil Remediation - Iliamna, AK</a> <br>
<br>
<a href="BGMR.htm" style="color:white" target="mainFrame">Big
Mountain Airport Remediation</a> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>

Any help which you could provide would be great. Thanks.