<HTML> <HEAD> <TITLE>esempio di menu</TITLE> <SCRIPT LANGUAGE='JavaScript'> <!-- function MakeArray() { var lngth = MakeArray.arguments.length; for ( i = 0 ; i<lngth ; i++ ) { this[i]=MakeArray.arguments[i] } } function prima() { var select = eval(document.menuform.elements[0].selectedIndex); if( (select >0) && (select<4) ) { var intl=new MakeArray( '','documentoA.html','documentoB.html','documentoC.html'); var nuove=intl[document.menuform.elements[0].selectedIndex]; var finestra = window.open(nuove,"documenti","Toolbar=no,status=no,scrollbars=yes, resizable=yes,menubar=yes,height=500,width=500"); finestra.focus(); } } function seconda() { var select = eval(document.menuform.elements[1].selectedIndex); if( (select >0) && (select<5) ) { var intl=new MakeArray( '','documento1.html','documento2.html','documento3.html','documento4.html'); var nuove=intl[document.menuform.elements[1].selectedIndex]; var finestra = window.open(nuove,"documenti","Toolbar=no,status=no,scrollbars=yes, resizable=yes,menubar=yes,height=500,width=500"); finestra.focus(); } } //--> </SCRIPT> </HEAD> <BODY> <P ALIGN=CENTER> <B> Esempio di menu a discesa: </B> <FORM NAME="menuform"> <SELECT NAME="primoMenu" onChange='prima();' > <option selected> PRIMO MENU <option> documento A <option> documento B <option> documento C </select> <SELECT NAME="secondoMenu" onChange='seconda();'> <option selected> SECONDO MENU <option> - documento 1 <option> - documento 2 <option> - documento 3 <option> - documento 4 </SELECT> </form> </BODY> </HTML> |