IT.COM

Simple JavaScript pull down quick menu

Spaceship
Watch
Impact
6
Code:
<SCRIPT LANGUAGE="JavaScript">
<!--
function which(form)
{
var order=form.jump.selectedIndex
if (form.jump.options[order].value != 0) 
{
location=form.jump.options[order].value;
}	
}
//-->
</SCRIPT>
	
<form name=form1>
<select name=jump onchange=which(this.form)>
<option value=0 selected>Quick Menu</option>
<option value="page1.html">Page 1</option>
<option value="Page2.html">Page 2</option>
<option value="Page3.html">Page 3</option>
</select>
</form>

B-)
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
What would I change to make each Page open in it's own browser window. Example click on Page 1 and it open's it's own window, then click on Page 2 and then it will open up a different window?
Thanks for your help!
 
0
•••
This should work for what you're wanting to do.

<form name=form1>
<select name=jump onchange=window.open(document.form1.jump.options[document.form1.jump.selectedIndex].value)>
<option value="page1.html">page 1</option>
<option value="page2.html">page 2</option>
<option value="page3.html">page 3</option>
</select>
</form>


:)
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back