Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>List/menu link values

List/menu link values

sturle
11-23-2004, 08:37 AM
Dear all,

Im trying to find a way in which the links placed in a list/menu, opens up in a new window, with these specific values:

- width: 800
- lenght: 700
- left: 200
- resizable:yes
- scrollbars: yes
- top: 80

For a pop-up it would be:
<a href=http://www.codingforums.com/archive/index.php/"#" onClick="window.open('yoururl.htm','title of a window','width=800;length=700;left=200;resizable=y es;scrollbars=yes;top=80;'')">Open in a new window</a>

However, I dont understand where I can insert these values in a list/menu script as below:

In 'Head':
<script language="JavaScript">

// Set the target window or frame
// _top opens in the same window
// _blank opens in a new window
// Use the frame name to open to a frameset target
var theTarget = "_blank";

function goThere(){
if(!document.theForm.theMenu.selectedIndex==""){
window.open(document.theForm.theMenu.options[document.theForm.theMenu.selectedIndex].value,theTarget,"");}}
</script>

In 'Body':
<form name="theForm">
<select name="theMenu" onChange="goThere()">
<option selected value="">Select a city
<option value="http://www.bbc.co.uk/weather/5day.shtml?world=0065" selected>Rome
(Italy) </option>
</select>
</form>

Does anyone have any suggestions?

As always; thanks for any help!

Best regards

hharchester
11-23-2004, 11:54 AM
Really don't understand your problem you seem to have the code already done, just add the window properties to it...

function goThere(){
if(!document.theForm.theMenu.selectedIndex==""){
var url = document.theForm.theMenu.options[document.theForm.theMenu.selectedIndex].value;
var newWin = window.open(url, "windowName", "width=800,length=700,left=200,resizable=yes,scrollbars=yes,top=80");
}
}

sturle
11-23-2004, 12:52 PM
Dear hharchester,

thanks for your help! My JS knowledge is quite limited, consequently I didnt work it out myself, eventhough it was right under my own nose...

Thanks!


 

TOP

For more info

setting a minimum size
Auto Preview of Image 
Refresh with a query s
JS Validation obsolete
Javascript Pop up func
Slide show transitions
I'm a newbie...please!
how to write coding in
Advanced Debug Info 
.js file doesn't work 

News Archive

Adding Graphic To Text
re-direct form after s
pop up window controls
Clock on homepage - He
passing a param from a
Password Procection wi
document.title in same
focus onload 
Counting Wrong from Ri
Help needed on how to 

Related stories:

Copy link text to clipboard
Problem with htmlarea
Random URL script help needed
Help with keystroke
possible to pass a form field name to a function, like this.value?
web forms proxy servers
Need HELP on combo boxes

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics