Ma ho un nuovo problema: i miei sotto menu si aprono e si chiudono se si clicca sul menu... vorrei che si chiudesse il menu anche quando clicco in un punto qualsiasi della pagina...
Ecco il codice della mia pagina
(mancando i file di stile quando si clicca sul un meno si aprono tutti i sotto menu)
Grazie a tutti per l'aiuto!!!codice:<html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> </head> <script language="JavaScript"> var items = 6 //var kleuract = "#828282" //colore sfondo intestazione del menu var lastMenu=items+1 function ShowHide(menuID) { document.getElementById("PrimoPiano").style.visibility="visible"; document.getElementById("MenuChiuso").style.visibility="hidden"; //document.PrimoPiano.style.visibility = "visible"; for(i=0;i<items;i++){ document.getElementById("Link" + i).className = "LINKSOFF" //document.all.item("Link" + i).style.backgroundColor = "" } if (lastMenu==menuID){ document.getElementById("Link" + menuID).className = "LINKSOFF" //document.all.item("Link" + menuID).style.backgroundColor = "" document.getElementById("PrimoPiano").style.visibility="hidden"; document.getElementById("MenuChiuso").style.visibility="visible"; lastMenu=items+1 }else{ document.getElementById("Link" + menuID).className = "LINKSON" // document.all.item("Link" + menuID).style.backgroundColor = kleuract lastMenu=menuID } } </SCRIPT> <body link="#FFFFFF" vlink="#FFFFFF" alink="#000000" leftmargin="10" topmargin="10" marginwidth="10" marginheight="10"> <div align="left" > <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="20"></td> </tr> <tr> <td height="20"> <div name="MenuChiuso" style="position:absolute; left:20; top:20; width:690px; visibility:visible; z-index: 3;" id="MenuChiuso" > <table border="0" cellpadding="0" cellspacing="0" bordercolor="#828282"> <tr bgcolor="#CCCCCC" > <td width="75" height="20" class="INTERNAL_HEADING" id="head0" onClick="ShowHide(0)"><font color="#FFFFFF">aaa</font></td> <td width="150" height="20" class="INTERNAL_HEADING" id="head1" onClick="ShowHide(1)"><font color="#FFFFFF">bbb</font></td> <td width="165" height="20" class="INTERNAL_HEADING" id="head2" onClick="ShowHide(2)"><font color="#FFFFFF">ccc</font></td> <td width="150" height="20" class="INTERNAL_HEADING" id="head3" onClick="ShowHide(3)"><font color="#FFFFFF">ddd</font></td> <td width="75" height="20" class="INTERNAL_HEADING" id="head4" onClick="ShowHide(4)"><font color="#FFFFFF">eee</font></td> <td width="75" height="20" class="INTERNAL_HEADING" id="head5" onClick="ShowHide(5)"><font color="#FFFFFF">fff</font></td> </tr> </table> </div> <div name="PrimoPiano" style="position:absolute; left:20; top:20; visibility:hidden; z-index: 3;" id="PrimoPiano" > <table border="0" cellpadding="0" cellspacing="0" bordercolor="#828282"> <tr bgcolor="#CCCCCC" > <td width="75" height="19" class="INTERNAL_HEADING" id="head0" onClick="ShowHide(0)"><font color="#FFFFFF">aaa</font></td> <td width="150" height="19" class="INTERNAL_HEADING" id="head1" onClick="ShowHide(1)"><font color="#FFFFFF">bbb</font></td> <td width="165" height="19" class="INTERNAL_HEADING" id="head2" onClick="ShowHide(2)"><font color="#FFFFFF">ccc</font></td> <td width="150" height="19" class="INTERNAL_HEADING" id="head3" onClick="ShowHide(3)"><font color="#FFFFFF">ddd</font></td> <td width="75" height="19" class="INTERNAL_HEADING" id="head4" onClick="ShowHide(4)"><font color="#FFFFFF">eee</font></td> <td width="75" height="19" class="INTERNAL_HEADING" id="head5" onClick="ShowHide(5)"><font color="#FFFFFF">fff</font></td> </tr> <tr> <td align="center" class="INTERNAL_LINK"> <div id="Link0" class="LINKSOFF"><font color="#FFFFFF"></font></div></td> <td align="left" valign="top" class="INTERNAL_LINK" > <div id="Link1" class="LINKSOFF"> <table width="100%" border="0" cellpadding="5" cellspacing="0" bordercolor="9B9B9B" bgcolor="9B9B9B"> <tr> <td> bbb1 bbb2</td> </tr> </table> </div></td> <td align="left" valign="top" class="INTERNAL_LINK"> <div id="Link2" class="LINKSOFF"> <table width="100%" border="0" cellpadding="5" cellspacing="0" bordercolor="9B9B9B" bgcolor="9B9B9B"> <tr> <td>ccc1</td> </tr> </table> <font color="#FFFFFF"> </font></div></td> <td align="left" valign="top" class="INTERNAL_LINK"> <div id="Link3" class="LINKSOFF"> <font color="#FFFFFF"> <table width="100%" border="0" cellpadding="5" cellspacing="0" bordercolor="#9B9B9B" bgcolor="#9B9B9B"> <tr> <td> <font color="#FFFFFF">ddd1</font> <font color="#FFFFFF">ddd2</font> <font color="#FFFFFF">ddd3</font></td> </tr> </table> </font></div></td> <td align="center" valign="top" class="INTERNAL_LINK"> <div id="Link4" class="LINKSOFF"><font color="#FFFFFF"></font></div></td> <td align="center" valign="top" class="INTERNAL_LINK"> <div id="Link5" class="LINKSOFF"><font color="#FFFFFF"></font></div></td> </tr> </table> </div> </td> </tr> </table> </div> </body> </html>
Delhpy![]()