...

View Full Version : dropdown menu help



civilaxis
10-02-2002, 02:13 AM
ok i have some dropdown menues and i want the links in them to open in new pop up windows that have a fixed size and whatnot so what do i do to get this.

alright thanks alot

starglow
10-02-2002, 05:01 AM
you mean like this?

(in header)

<script language="JavaScript">
<!-- hide from JavaScript-challenged browsers
function openWindow(url) {
popupWin = window.open(url,'new_page','width=500,height=320,scrollbars=yes')
}
function openWindow2(url) {
popupWin = window.open(url,'new_page','width=640,height=420,scrollbars=yes')
}
// done hiding -->
</script>


(in body)


<b>Example Drop Down Box with open new window:</b>
<br>
<form name="form">
<select name="links">
<option value="select">Please select
<option value="JavaScript:openWindow('URL')">URL number one
<option value="JavaScript:openWindow2('URL')">URL number two

</select>
<INPUT type="button" name="go" value="Go" onClick="window.location=document.form.links.options[document.form.links.selectedIndex].value">

I think that should do it... if you want all the popups the same size then you dont need the openwindow2, if you want more then two then just copy/paste and change the 2 to 3. you can change the sizes of them yourself and make no scrollbars if you want.

cg9com
10-03-2002, 03:16 AM
the section i put in bold are the actual popups configuration section

here are some options
window.open("about:blank","Popup","width=100 height=100 toolbar=0 location=0 menubar=0 status=0 directories=0 scrollbars=0 resizable=0 copyhistory=0");

<form>
<select onChange="PopUpName=window.open('','PopUpName');PopUpName.location=options[selectedIndex].value;">
<option value="http://www.website.com">website.com</option>
<option value="http://www.webpage.com/">webpage.com</option>
</select>
</form>

and here are a few more dropdown options

instant page load

<form>
<select onChange="location=options[selectedIndex].value;">
<option value="http://www.website.com">website.com</option>
<option value="http://www.webpage.com/">webpage.com</option>
</select>
</form>

load page with button

<form>
<select name="menu">
<option value="http://www.website.com">website.com</option>
<option value="http://www.webpage.com/">webpage.com</option>
</select>
<input type="button" onClick="location=this.form.menu.options[this.form.menu.selectedIndex].value;" value="GO">
</form>

load into specific frame

<form>
<select name="menu">
<option value="http://www.website.com">website.com</option>
<option value="http://www.webpage.com/">webpage.com</option>
</select>
<input type="button" onClick="top.frames['FrameName'].location=this.form.menu.options[this.form.menu.selectedIndex].value;" value="GO">
</form>




there are a few, theres more the drop down can do though



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum