Setting a <div> visibility in a parent window from an iframe

M

Micky Pearce

Hi

I have a page containing a hidden <div> called 'controls' plus an <iframe>
containing a second page. I need to be able to set the visibility of the
'controls' div when the page in the iframe loads. Is this possible?

Using this code I can change the visibility from a link in the parent
window:

onClick="document.getElementById('controls').style.visibility='visible'"

but if I try something like

parent.getElementById('controls').style.visibility='visible'

It just replaces the parent with the page from the iframe.

Cheers
Mickey
 
M

Mick White

Micky said:
Hi

I have a page containing a hidden <div> called 'controls' plus an <iframe>
containing a second page. I need to be able to set the visibility of the
'controls' div when the page in the iframe loads. Is this possible?

Using this code I can change the visibility from a link in the parent
window:

onClick="document.getElementById('controls').style.visibility='visible'"

but if I try something like

parent.getElementById('controls').style.visibility='visible'
parent.document.getElementById('controls').style.visibility='visible'

Mick


It just replaces the parent with the page from the iframe.

Cheers
Mickey
 

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

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top