Sizzling HTML Jalfrezi's Tip of the Day 
  - Using drop-down lists for navigation -  

By using of some simple JavaScript code you can save screen space by creating a drop-down list to help visitors navigate your site.

example of code

<FORM NAME="linkform">
<SELECT NAME="linkselect">
<OPTION SELECTED>Sizzling HTML Jalfrezi</OPTION>
<OPTION>McLaren F1 Resource</OPTION>
<OPTION>Internet Magazine</OPTION>
</SELECT>
<INPUT TYPE="BUTTON" Value="Go!" Name="Link_Button"
onClick="window.open(URLarray[document.linkform.linkselect.selectedIndex], 'target_or_window')"
</FORM>
 
<SCRIPT LANGUAGE="Javascript">
<!--//hide script from old browsers
var NUMBER_OF_LINKS=3
URLarray=new Array(NUMBER_OF_LINKS)
URLarray[0]="../iniframe.htm"
URLarray[1]="http://www.woodhill.co.uk/f1/"
URLarray[2]="http://www.internet-magazine.com/"
//end hiding contents -->
</SCRIPT>

how it renders

As you can see, the code is split into two sections; HTML to produce the drop-down list, followed by JavaScript to do the navigation. The areas of code which you should adapt as required are highlighted in bold. From top to bottom, they are:


previous tips of the day