Add a JavaScript menu to your web site

From The IT Community
Jump to: navigation, search

This will show you how to add a JavaScript menu to your web site.

In this example we use it to access some pages on The IT Community in a fast and simple way.

First put the following into the <head> section of your site:

 function openDir (form) {
        if ( == 0)
        if ( == 1)
        if ( == 2)
        if ( == 3)
 // end of script -->

This is your JavaScript menu which defines where the links point to.

Now put the following into the <body> section of your site:

<FORM NAME="myform">
 <SELECT NAME="directory">
    <OPTION>Popular Pages</OPTION>
    <OPTION>Create a new Page</OPTION>
 <INPUT TYPE="button" NAME="button" VALUE=" Go " ONCLICK="openDir(this.form)">

That´s it, refresh your page and have fun with your new menu.

Was this article helpful? Then please donate to keep The IT Community alive...

If you found this article helpful please share it, comment and help others by writing your own article.

Translate this page:

Articles found in the same category:
(max. 20 shown)