By admin, 1 year and 10 months ago

Centered popup window

function popUp(theURL, myWidth, myHeight) {var winName = 'feedback';var features='toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0';//var myWidth = 290;//var myHeight = 360;var isCenter = 'true'; if(window.screen)if(isCenter)if(isCenter=="true"){   var myLeft = (screen.width-myWidth)/2;   var myTop = (screen.height-myHeight)/2;   features+=(features!='')?',':'';   features+=',left='+myLeft+',top='+myTop; } var handle = window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);  handle.opener = window;  handle.focus(); return handle;}

No comments

Be the first to write a comment on this post.

Write a comment

If you want to add your comment on this post, simply fill out the next form:

You have to be logged-in to write a comment: (Log-in).

No trackbacks

To notify a mention on this post in your blog, enable automated notification (Options > Discussion in WordPress) or specify this trackback url: http://​www.tai.ro/​2008/​04/​16/​centered-popup-window/​trackback/