Site Navigation6. All Browsers |
|
Join the DiscussionMore of this FeatureIntroduction Drop Down Navigation PHP Script Javascript Only No Button Navigation Combo Box Combo Navigator Not Found We can combine the javascript and PHP versions to give a version that works on all browsers but only displays the button on browsers without javascript. The code to do this is as follows:
<form name="ex3"
action="xfer.php"
method="POST">
<div align="center"> <select name="xfer" size="1" onmouseup= "location = '' + this.options <option value="bltime1.htm">Introduction</option> <option value="bltime2.htm">Get the Script</option> <option value="bltime3.htm">Configure the Script</option> <option value="bltime4.htm">Daylight Saving</option> </select> <noscript><input type="submit" value="Go!" /> </noscript> </div></form> Now all we need to do in order to place as many page links within this single drop down box is to add extra option statements for each page that we want to link to. If the open list becomes too long to be able to display properly on the screen then a scroll bar will be automatically added so that the visitor can scroll through your list of links to find the one that they want. Of course if we want to allow a really large number of pages to be selected then the list can become too long. In that case we may want to list the most popular pages but allow our visitors to enter the less popular page names themselves. To do this we need a Combo Box in place of the drop down list. Note that the script and the descriptions of the functions that it contains are rewritten from the "Ask Felgall" website with the permission of the copyright owner. |

