Hiding a div in a popup window

K

Kiran Makam

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://kiranmn.netfirms.com/temp/opener.html

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
 
K

Kiran Makam

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,130
Latest member
MitchellTe
Top