11 Dec, 2003
Javascript: Pull-down menus with pop-up links
Posted by: Jennifer In: Script snippet
Original Script: The JavaScript Source
Corrections: The original was incorrectly pasted on the source page, so it failed to execute properly. I fixed that problem and also added an option for background and text colors on the pull-down menu. Scrollbars and toolbars were added to the pop-up links.
Instructions: Change the bold code to meet your site's needs.
Customizations: Go for it! The menu font size is set at 10pt by default, but I use 9pt on BB. The background color is white and text is black, but delete the options or change to meet your needs.
Place somewhere in the HEAD tags:
<script language="JavaScript">
function formHandler(form) {
var windowprops = "toolbar=yes,location=yes,status=yes,menubar=yes,
scrollbars=yes,resizable=yes,width=500,height=500";
var URL = form.site.options[form.site.selectedIndex].value;
popup = window.open(URL,"MenuPopup",windowprops);
}
</script>
Place in menu location:
<form name=form>
<select name="site" size="1" onChange="formHandler(this.form)" style="background-color: FFFFF; color: 00000; font-size:10pt;">
<option selected>YOUR MENU DESCRIPTION</option>
<option value="YOUR LINK">YOUR LINK DESCRIPTION</option>
</select>
</form>