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="#" 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
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="#" 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