View Full Version : Drop-down menu that launches a pop-up window...


Rice28m
08-21-2004, 07:26 PM
Do those exist? If possible can I be pointed to a page with these instructions. I've tried google, but no luck yet. Thank you.

Flitt7o2
08-21-2004, 07:38 PM
i think if you just add target="_blank" when you click the item in the drop down menu it should would.

Rice28m
08-21-2004, 07:42 PM
Thanks, I've thought of that, but with that you can't choose the size and positioning of the window like with a real pop-up. But, this will do, thank you.

Flitt7o2
08-21-2004, 07:54 PM
ahh, sorry i couldnt get the position of it though :-/ np for the help :-)

Monkey Bizzle
08-21-2004, 08:17 PM
hey, i figured it out! i'll be back in a second with the code... sit tight!

Monkey Bizzle
08-21-2004, 08:28 PM
in the <head> section of your page that you want to put the drop down menu on... put this code... it can be as long or as short as you want it depending on how many things are in your drop down... the below is for 5 things but you can copy and paste more if you want too... i did alternating colors so you could see what part of the code was a whole "pop up." you have to change the part where it says URL1 etc to whatever you want the NAME of the pop up to be... change the bold to your stuff, and where it says location=0, menubar=0, etc... if you leave it as 0, it won't be in your pop up and if you change it to 1, it will be in your pop up... like if you make resizable = 1 then people will be able to resize the window and 0 means they can't. i hope you are still with me!! =)

<script language="javascript" type="text/javascript">
//<!--
function URL1()
{ window.open
("URL","popup","width=740px,height=565px,location=0,menubar=0,resi zable=0,scrollbars=0,status=0,titlebar=1,toolbar=0")
}
function URL2()
{ window.open
("URL","popup","width=740px,height=565px,location=0,menubar=0,resi zable=0,scrollbars=0,status=0,titlebar=1,toolbar=0")
}
function URL3()
{ window.open
("URL","popup","width=740px,height=565px,location=0,menubar=0,resi zable=0,scrollbars=0,status=0,titlebar=1,toolbar=0")
}
function URL4()
{ window.open
("URL","popup","width=740px,height=565px,location=0,menubar=0,resi zable=0,scrollbars=0,status=0,titlebar=1,toolbar=0")
}
function URL5()
{ window.open
("URL","popup","width=740px,height=565px,location=0,menubar=0,resi zable=0,scrollbars=0,status=0,titlebar=1,toolbar=0")
}
-->
</script>

then... use this code as your actual drop down menu and you can put it whereever in your page that you want it to appear... where it says here URL1, URL2, etc... change that to the NAME of the corresponding pop up that you did above... so if you change URL1 to ME then below, you would have to change that as well... do not put the page addresses in this code. you do that above...

<form name="gotolocation1" method="POST" ACTION=URI>
<select name="dropdownmenu">
<option value="javascript:URL1()">Text that appears in menu</option>
<option value="javascript:URL2()">Text that appears in menu</option>
<option value="javascript:URL3()">Text that appears in menu</option>
<option value="javascript:URL4()">Text that appears in menu</option>
<option value="javascript:URL5()">Text that appears in menu</option>
</select>
<input type="button" onClick="location =
document.gotolocation1.dropdownmenu.options
[document.gotolocation1.dropdownmenu.selectedIndex].value;"
value="Go">
</form>


I hope that you understand... I tried to break it down as best as i could and please let us know if you don't get it so myself or someone else can explain it better!!!

Rice28m
08-21-2004, 08:32 PM
Thanks, I'm going to try it out right now, thank you. Cool.

Monkey Bizzle
08-21-2004, 08:35 PM
i am sure there is a code out there for this but i couldn't find it either so i took a combination of the drop down code and the pop up code and put them together so PLEAE let me know if it works!! i tested it out on my system but that never means much!! LOL!

Rice28m
08-21-2004, 09:20 PM
Works!!!

See it in action: No advertising, please

Thank you so much. If you look around, you'll see why its a handy feature for launching flash movies.