Ciao, volevo scrivere una mia pillola e non sapevo ke titolo inserire nel campo. Cmq ho pensato di creare un menu un pò particolare, forse chi legge il listato capirà, forse perché è fatto un po meglio...
Questo è il codice, dimenticavo funziona su tutti i browser di nuova e vecchia generazione!
<html>
<head>
<title></title>
<style type="text/css" media="screen" id="stilista">
<!--
a:link, a:active, a:visited {font:bold 0.8pc arial; color:blue; text-decoration:underline}
a:hover {color:blue; text-decoration:underline overline}
-->
</style>
</head>
<body>
<script language="javascript">
<!--
var voci=new Array();
voci[0]="Articoli";
voci[1]="Chat";
voci[2]="Forum";
voci[3]="Svago";
var wid=140;
var hei=25;
var toppa=2;
var dif=10;
var finBro=document.all?"document.body.clientWidth":do cument.layers?"window.innerWidth"(document.getElementById)&&(!document.all))?"windo w.innerWidth":"document.body.clientWidth";
var subVoces=new Array();
subVoces[0]=["Articolo.1","Articolo.2","Articolo.3","Articolo.4 "];
subVoces[1]=["Chat Stude","Chat oper"];
subVoces[2]=["Forum Studenti","Forum AntiProf."];
subVoces[3]=["x Uomini","x Donne"];
var link=new Array();
link[0]=["uno.htm","due.htm","tre.htm","quattro.htm"];
link[1]=["cinque.htm","sei.htm"];
link[2]=["sette.htm","otto.htm"];
link[3]=["nove.htm","dieci.htm"];
var widHome=wid*(voci.length)+dif*(voci.length);
var leftHome=((eval(finBro)/2)-(widHome/2));
if(((document.getElementById)&&(!document.all))||( document.all)) {
document.write("<div id=\"home\" style=\"position:absolute; width:"+widHome+"px; left:"+leftHome+"px; top:20px\">");
for(var x=0; x<voci.length; x++) {
document.write("<div style=\"position:absolute; top:"+toppa+"px; left:"+((wid*x)+(dif*x))+"px; width:"+wid+"px; height:"+hei+"px; background-color:red; text-align:center; font:bold 1.3pc arial; color:white; border:black 1px solid\" onmouseover=\"listaMenu["+x+"].visibility=\'visible\';\" onmouseout=\"listaMenu["+x+"].visibility=\'hidden\';\">"+voci[x]+"</div>");
document.write("<div id=\"menu"+x+"\" style=\"position:absolute; top:"+((toppa+hei)-1)+"px; left:"+((wid*x)+(dif*x))+"px; width:"+wid+"px; background-color:red; text-align:center; visibility:hidden; border-left:black 1px solid; border-right:black 1px solid; border-bottom:black 1px solid; border-top:black 0px none\" onmouseover=\"listaMenu["+x+"].visibility=\'visible\';\" onmouseout=\"listaMenu["+x+"].visibility=\'hidden\';\">");
for(var y=0; y<subVoces[x].length; y++) {
document.write(subVoces[x][y].link(link[x][y])+"
");
};
document.write("</div>");
};
document.write("</div>");
}
else if(document.layers) {
document.write("<layer id=\"home\" position=\"absolute\" width=\""+widHome+"px\" left=\""+leftHome+"\" top=\"20px\">");
for(var x=0; x<voci.length; x++) {
document.write("<layer position=\"absolute\" top=\""+toppa+"px\" left=\""+((wid*x)+(dif*x)+dif)+"px\" width=\""+wid+"px\" height=\""+hei+"px\" bgcolor=\"red\" onmouseover=\"listaMenu["+x+"].visibility=\'show\';\" onmouseout=\"listaMenu["+x+"].visibility=\'hide\';\"><center><font color=\"white\" size=\"+2\" face=\"arial\">"+voci[x]+"</font></center></layer>");
document.write("<layer name=\"menu"+x+"\" position=\"absolute\" top=\""+((toppa+hei)-1)+"px\" left=\""+((wid*x)+(dif*x)+dif)+"px\" width=\""+wid+"px\" height=\""+hei+"px\" visibility=\"hide\" bgcolor=\"red\" onmouseover=\"listaMenu["+x+"].visibility=\'show\';\" onmouseout=\"listaMenu["+x+"].visibility=\'hide\';\"><center>");
for(var y=0; y<subVoces[x].length; y++) {
document.write(subVoces[x][y].link(link[x][y])+"
");
};
document.write("</center></layer>");
};
document.write("</layer>");
}
var listaMenu=new Array();
for(var x=0; x<voci.length; x++) {
listaMenu[x]=document.all?eval("document.all['menu"+x+"'].style"):document.getElementById?eval("document.ge tElementById('menu"+x+"').style"):eval("document.l ayers['home'].document.layers['menu"+x+"']");
};
//-->
</script>
</body>
</html>
ciao!