Welcome to WebmasterWorld Guest from 54.196.175.173

Forum Moderators: open

Message Too Old, No Replies

Change div in parent window

Error ..... Has no properties

     

humpg

5:18 pm on Mar 19, 2007 (gmt 0)

10+ Year Member



I currently have a page that runs a function to open a popup window:

function StartApp() {

window.open('login.asp','', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=750,height=550,left=100, top=100');
document.getElementById("launcher").style.zIndex = 1;
document.getElementById("running").style.zIndex = 2;

}

This function opens the window and changes the z-index of two divs on this page. This all works fine.

In the popUp window I have this code:

function cleanUp() {
parent.document.getElementById("running").style.zIndex = 1;
parent.document.getElementById("launcher").style.zIndex = 2;
}

This function is called in

<body onunload="javascript:cleanUp();">

But it doesn't change the z-index on the parent window when I close the popUp.

I get an error message in firefox saying:

Error: document.getElementById("running") has no properties

Any one know what I am doing wrong? or is this possible?

Moby_Dim

8:05 pm on Mar 19, 2007 (gmt 0)

10+ Year Member



I did not try this before (disclaimer ;), but what if to try window.opener... instead of parent...?

Moby_Dim

8:19 pm on Mar 19, 2007 (gmt 0)

10+ Year Member



I've just tried this with fontSize and color, and it worked.

humpg

11:32 am on Mar 20, 2007 (gmt 0)

10+ Year Member



Thanks a bunch Moby_Dim,

window.opener.document.... worked perfectly

 

Featured Threads

Hot Threads This Week

Hot Threads This Month