View Full Version : focus popup onload

12-06-2006, 06:17 AM
I want to load a popup - as chromeless as I can get it - centre screen.

This will almost do it, but regardless of my attempt to force focus, it stays behind the loader.

If I could get rid of the loader that would be nice, but I'm thinking that is impossible. Still, all I need for now is for the popup to come to the front.


<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<script LANGUAGE="javascript">
function popUp(URL,popW,popH) {
var topPos = (screen.availHeight-popH)/2, leftPos = (screen.availWidth-popW)/2;
mywin=window.open(URL,'popup','resizable=no, toolbar=no, location=no, status=no, scrollbars=no, menubar=no, titlebar=no, width=' + popW + ',height=' + popH + ',left=' + leftPos + ',top=' + topPos + ',screenX=' + leftPos + ',screenY=' + topPos);''
// -->


<body onload="javascript:popUp('mypopup.html',700,450)">

Any ideas as to what I'm doing incorrectly?

12-06-2006, 10:21 AM
it doesnt make sense to me that the pop up isn't in front. unless you have something in the loader window that is drawing focus back to it. when a popup is created, it has focus by default. it should always be on top unless explicitly told not to (i.e. drawing focus to main window or blur() on pop up. )

do you have any added software/plugins that might push pop-ups to the back? because the code you provided pops the window up in front and it keeps focus for me.

12-06-2006, 11:48 AM

Something is very strange. If I upload the pages to the web and load page1.html, it all works as expected.

But if I do the same thing offline, page1.html still has focus.

Maybe I should reinstall IE7.