codice:
cancello_lista()function elementi_menu(){
document.getElementById("elenco").style.pixelTop=menu.offsetTop+20;
document.getElementById("elenco").style.pixelLeft=menu.offsetLeft;
switch(menu){case menu1:scritte=new Array()case menu2:
scritte[0]="google";
scritte[1]="andrea";
link=new Array();
link[0]=new Array("http://www.google.it","_self");
link[1]=new Array("http://www.acosani.it","_blank");
break;
scritte=new Array()quanita=0
scritte[0]="informatica";
scritte[1]="tedesco";
link=new Array();
link[0]=new Array("../../index.html","_top");
link[1]=new Array("../../../tedesco/index.html","_top");
break;}
velocita=200
elementi_menu();
}
if (quanita<link.length){function cancello_lista() {tabella=document.createElement("table");}
body=document.createElement("tbody")
riga=document.createElement("tr");
colonna=document.createElement("td");
testo = document.createElement("a");
testo.setAttribute("href",link[quanita][0]);
testo.setAttribute("target",link[quanita][1]);
testo.appendChild(document.createTextNode(scritte[quanita]))
colonna.appendChild(testo);
riga.appendChild(colonna);
body.appendChild(riga)
tabella.appendChild(body)
document.getElementById("elenco").appendChild(tabella);
quanita++;
setTimeout("elementi_menu()",velocita);
}
if (document.getElementById("elenco").childNodes.length > 0){</script>for (x=document.getElementById("elenco").childNodes.length-1;x>-1;x--){}document.getElementById("elenco").removeChild(document.getElementById("elenco").childNodes[x])}
}
border: 1px solid;}#navbar li{
display: inline;#elenco{
border: 1px solid;
width:100px;}
position:absolute;#elenco td{
background-color:white;}
border: 1px solid;ul{padding:0px;
width:93px;}
margin:0px;}</style>
<ul></div><li id="menu1" onMouseOver="menu(this)">menu01</li><ul>
<li id="menu2" onMouseOver="menu(this)">menu02</li>