PDA

View Full Version : Popup Alternative



stupidav
06-21-2007, 06:38 PM
I have been working on a standard dropdown menu that opens the selected item in a new window. I got that working but in IE it considers it to be a "Popup" and blocks it. So I am trying to do it as a DHtml window, instead, but I can't get any thing to work from the drop down menu. Any help is greatly appreciated.

Heres what I have for the Popup window.

var win=null;

function jumptolink(what){
var selectedopt=what.options[what.selectedIndex]
var myname=selectedopt.getAttribute("t")
var pos=selectedopt.getAttribute("p")
var w=selectedopt.getAttribute("w")
var h=selectedopt.getAttribute("h")
var scr=selectedopt.getAttribute("s")

if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}

if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100
;TopPosition=(screen.height)?(screen.height-h)/2:100;}

else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}

settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scr+',location=no,directories=no,status=no,menubar=no,toolbar=no,resiz able=yes';

win=window.open(selectedopt.value,myname,settings);}

<form name="form4">
<select name="state" size="1" style="background-color:#FFFFF2" onChange="jumptolink(document.form4.state)">

<option value="#" selected>Select a State</option>

<option value="http://www.example.com/asc_AL.htm" t='Texas' w='400' h='400' s='yes' p='center'>Texas</option>
<option value="http://www.example.com/asc_AL.htm"t='Alabama' w='400' h='200' s='no' p='center'>Alabama</option>
</select>
<input type="button" value="Go" onClick="jumptolink(document.form4.select1)">
</form>

I have tried different DHTML windows but no luck calling them properly, I have the "dhtmlwindow" and had the files installed, and calling this function just like I did above with no luck either.

<script type="text/javascript" src="windowfiles/dhtmlwindow.js">
function jumptolink(what){
var googlewin=dhtmlwindow.open("googlebox", "iframe", "http://google.com", "Google Web site", "width=700px,height=450px,resize=1,scrolling=1,center=1", "recal")}
</script>