Results 1 to 1 of 1

Thread: Hide parent element from an iframe link

  1. #1
    Join Date
    Feb 2010

    Question Hide parent element from an iframe link


    I'm working on a project, and I need to find a solution to hide a DIV element by clicking on a link. The problem is that the DIV element is located in one window (parent window), while the link is located in another window (an iframe).

    Here is the html code for the two pages:

    index.html (parent window)
    <div id="element">element to be hidden</div>
    <iframe src="iframe.html" width="320" height="40" frameborder="1" name="iframe"></iframe>

    iframe.html (iframe window)
    <a href="">click here to hide the parent window element!</a>

    If you could be as specific as possible with your solution, that would be great and much appreciated! I'm not skilled with JavaScript and CSS.

    I searched Google for a few hours, but I couldn't solve the problem, even though my first guess is that this is a pretty simple thing to do. ;)

    Anyhow, I noticed some were using a combination of JavaScript and CSS (display:none;) for cases close to this one.

    Below you can find a small archive with the two pages listed above.

    Thank you very much!
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center