|
Java Menu Source CodeThis is a menu which will open the selected page in the same frame as where the menu is placed.
The following is placed in the HEAD part of the page <SCRIPT LANGUAGE="JavaScript"> <!-- function openDir (form) { if (form.directory.selectedIndex == 0) parent.window.location.href="advancedhtml.htm" if (form.directory.selectedIndex == 1) parent.window.location.href="frame.htm" if (form.directory.selectedIndex == 2) parent.window.location.href="faq.htm" if (form.directory.selectedIndex == 3) parent.window.location.href="/" } // end of script --> </SCRIPT> The form is placed anywhere on the page between the BODY tags. <FORM NAME="myform"> <SELECT NAME="directory"> <OPTION SELECTED="SELECTED">Advanced HTML Page</OPTION> <OPTION>Frames Page</OPTION> <OPTION>HTML FAQ</OPTION> <OPTION>Back To Start Page</OPTION> </SELECT> <INPUT TYPE="button" NAME="button" VALUE=" Go " ONCLICK="openDir(this.form)"> </FORM> When you choose an option from the list the page will appear in the same frame as the menu. You could modify it to make the page go into a different frame as I have do on The Frames Page. It consists of 2 parts, the actual Java code is in the Head part of the page and that is where all the names of the pages are typed. The second part of the menu is a simple form where you put the names of the pages that you want to appear. When you choose something from the list the Java code relates this to the right page and opens it. The advantage of this is that your page may be called `asr.htm` but in the menu it can be seen as `Annual Spending Report`.
The only problem is that if you use a browser that doesn`t support Java then the menu will still appear but it won`t do anything. This menu has been tested in Internet Explorer 3 & 4 and Netscape Navigator 3 & 4 and works perfectly in all of them.
Advanced HTML Home Copyright © 1997 - 2024 Hosted by IONOS
|