PDA

View Full Version : Pop-up Windows



SawnDiddle
07-13-2006, 03:04 PM
Ok, I have this javascript code but IE is having problems using it. I like the code because if the user does not or can not use javascript, they can still access the page.

Header Code

<script language="javascript" type="text/javascript">
<!--
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
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='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,re sizable=yes';
win=window.open(mypage,myname,settings);}
// -->
</script>

Link Code

<a href="pop-up/standbyDetails.htm" onClick="NewWindow(this.href,'Typical Case Study','300','305','yes','center');return false">Major Components</a>

jscheuer1
07-14-2006, 04:14 PM
That looks like a gutted version of the output from this script wizard:

http://www.dynamicdrive.com/dynamicindex8/popwin.htm

If you use that link, set the specifications you desire and use the code that it generates, there should be no problems in IE.