views:

520

answers:

2

It seems simple but I did not find a way. I open a window:

a. I need that while opening the window is minimized. b. when finished loading, I need to be normalized and then focus on the parent window.

--Code

var openwindow = null;

$(function(){

    openwindow = window.open("http://www.domine.com", "winx", "width=200,height=30,toolbar=0,location=0,status=0,scrollbars=0,menubar=0,directories=0,resizable=0");

    //minimized -> openwindow

    $(openwindow).load(function(){
     //normalized -> openwindow
     ...
     //focus in current window
    });
});

thanks

A: 

First, open your popup in a very small size, then in the popup window:

On load finish:

window.resizeTo(screen.width,screen.height); //this would maximize it, set the numbers to 200,30 to match your requirement
window.parent.opener.focus();
Mohammad
the issue is that I have no control over the new window
andres descalzo
you can resize the popup from parent but you will have no control on when it finishes loading then.openwindow.resizeTo(winWidth,winHeight);
Mohammad
A: 

In the onload event of your child window, you can call window.opener.focus() or window.opener.document.focus() to re-focus on the parent. I'm not sure there's any way to minimize the child window while it's loading, however.

MusiGenesis