View Full Version : Drop-down menus
How do I create one of those drop-down menus where people select an an item and it takes you to a web page or whatever?
Put this between the <head> and </head>
<BLOCKQUOTE><font size="1" face="Verdana">code:</font><HR><pre>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function navi(form) {
var myindex=form.jump.selectedIndex;
location.href=(form.jump.options[myindex].value);
}
// End -->
</SCRIPT>
[/code]
And then for your drop down menu:
<BLOCKQUOTE><font size="1" face="Verdana">code:</font><HR><pre>
<form name="dasform">
<select name="jump">
<OPTION VALUE="apage.html" selected>A Page!</option>
<OPTION VALUE="../anotherpage.html">Another page on your site!</option>
<OPTION VALUE="http://www.surreal-southend.co.uk">A web site elsewhere!</option>
</SELECT>
<input type="Button" value="Go!" onclick="navi(this.form)">
</form>
[/code]
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.