Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

i have a web application which open a popup child window for notification, either parent window maximize or minimize.

now my problem is,

if parent window is minimize and child window open, on click of child window button,
maximize parent window and close child window.

i had used window.opener but it works only on IE.

Thanks in advance
Posted
Comments
Mahesh Bailwal 20-Jun-13 2:19am    
Can you share your code.
prateekfgiet 20-Jun-13 4:31am    
code at Parent Page:
Java script Function:
function popitup(url) {
newwindow = window.open(url, 'name', 'height=200,width=150');
if (window.focus) { newwindow.focus() }
return false;

window.moveTo(0, 0);
window.resizeTo(screen.width, screen.height);

}
onclick="popitup('ChildPopUp.aspx')"

Code at Child Page:
JavaScript Function:
function SwitchToParent() {
window.opener.focus();
}
onclick="SwitchToParent();"

it works on IE but not at crome and firefox

1 solution

FF4+ prevernt window raising and lower by default, you can enable in options: Tools->Options->Content->Advanced... (in "Enable JavaScript" row)->Check "Raise or lower windows"

Check this link
window.opener.focus() problem in FF5+[^]
 
Share this answer
 
Comments
prateekfgiet 20-Jun-13 7:18am    
Its Working for FireFox but still have problem with Crome.

Is there any Solution for crome??
Mahesh Bailwal 20-Jun-13 9:34am    
Please check this link.It may help

http://code.google.com/p/chromium/issues/detail?id=1383

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900