Hiding a div in a popup window

Hiding a div in a popup window

Post by Kiran Maka » Thu, 10 Mar 2005 14:58:32


Hi all,

If a page is opened in a popup window, banner1 should be hidden, but it
should be visible if opened in a normal window.

I am using following code:

<script>
function hideBanner(){
if(window.opener){
document.write('<style>#banner1{ display:none; }</style>');
}
}
hideBanner()
</script>

See demo page: http://www.yqcomputer.com/

This code is working as expected in Win2000/IE 6.

But in
OS: Windows XP Home SP2
IE: 6.0.2900.2180.xpsp_sp2_rtm.040803-2158

banner1 is hidden even in opener (that is parent) window. Anything to
do with return value of 'window.opener' property?

Any of you guys facing this problem in your browser?

Thanks in advance

- Kiran Makam
 
 
 

Hiding a div in a popup window

Post by Kiran Maka » Thu, 10 Mar 2005 15:07:51

To test the demo page (in parent window as well as child window), copy
the link kiranmn.netfirms.com/temp/opener.html and paste it in your
browser's address bar.

if you click the link, page openes in a popup and banner1 getts hidden.

- Kiran Makam