Hi!
I have this menu that works really good, but i want it to do one thing:
When a submenu is open, and I click a new link (not in the same submenu) i want the open submenu to close again.
I’m not at all good at js so i reallt would appreciate som help.
The code looks like this:
<SCRIPT>
function menu(obj) {
if(obj.style.display==’none’)
{
obj.style.display=”
}
else obj.style.display=’none’
}
</SCRIPT>
and body looks like this:
<a href=”../public/start.htm”>Hem</a><br>
<a href=”../public/foretaget.htm”>Företaget</a><br>
<SPAN OnClick=”menu(tjanster)”>
<a href=”../public/tjanster.htm”>Tjänster</a></SPAN><br>
<SPAN STYLE=”display: none” ID=”tjanster”>
<a href=”../public/webdesign.htm”>Webdesign</a><br>
<a href=”../public/positionering.htm”>Positionering</a><br>
<a href=”../public/webshop.htm”>Webshop</a><br>
</SPAN>
<SPAN OnClick=”menu(simple)”>
<a href=”../public/simpleupdate.htm”>SimpleUpdate</a>
</SPAN><br>
<SPAN STYLE=”display: none” ID=”simple”>
<a href=”../public/demo.htm”>Demo</a><br>
<a href=”../public/kop.htm”>Köp</a><br>
</SPAN>
<SPAN OnClick=”menu(referenser)”>
<a href=”../public/referenser.htm”>Referenser</a>
</SPAN><br>
<SPAN STYLE=”display: none” ID=”referenser”>
<a href=”../public/referenser_web.htm” target=”main”>Webdesign</a><br>
<a href=”../public/referenser_partners.htm”>Partners</a>
<br></SPAN>
<a href=”../public/kontakt.htm”>Kontakt</a><br>
<a href=”../public/support.htm”>Support</a><br>
<a href=”../public/jobb.htm” target=”main”>Jobb</a>
So, if i click the link [B]<a href=”../public/tjanster.htm”>Tjänster</a>
Please help me….
Thanks in advance
/Lari