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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Micky Pearce

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

    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="docume nt.getElementBy Id('controls'). style.visibilit y='visible'"

    but if I try something like

    parent.getEleme ntById('control s').style.visib ility='visible'

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

    Cheers
    Mickey


  • Mick White

    #2
    Re: Setting a &lt;div&gt; visibility in a parent window from an iframe

    Micky Pearce wrote:
    [color=blue]
    > 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="docume nt.getElementBy Id('controls'). style.visibilit y='visible'"
    >
    > but if I try something like
    >
    > parent.getEleme ntById('control s').style.visib ility='visible'[/color]

    parent.document .getElementById ('controls').st yle.visibility= 'visible'

    Mick
    [color=blue]
    >
    > It just replaces the parent with the page from the iframe.
    >
    > Cheers
    > Mickey
    >
    >[/color]

    Comment

    Working...