How to open new window (popup) and center on screen

22 Jul

Hi …

the advantage  of this java script function you just place in master page and call any where at page ……..
<title>Popup Window</title>
<script language=”javascript” type=”text/javascript”>
var win=null;

function NewWindow(mypage,myname,w,h,scroll,pos){



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

settings=’width=’+w+’,height=’+h+’,top=’+TopPosition+’,left=’+LeftPosition+’,scrollbars=’+scroll+’,l ocation=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes’;,myname,settings);}
// –>


<table width=”100%” height=”100%”>

<td align=”center” valign=”middle”>
<a href=”; onclick=”NewWindow(this.href,’newwindow’,’450′,’500′,’yes’,’center’);return false” onfocus=”this.blur()”>Popup Window</a>


Leave a comment

Posted by on July 22, 2011 in Java Script


Tags: , , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: