Results 1 to 1 of 1

Thread: Reference Parent from Nested Iframe

  1. #1
    Join Date
    Jun 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Reference Parent from Nested Iframe

    Hello, I have a script which works from my main page, but I need to embed it also into an iframed page, and have it affect the main page from there as well. Let me try to explain...

    In my main page, I have the following iframes:

    Code:
    <iframe id="main">
    <iframe id="player">
    <control buttons embedded on main page, along with the iframes>
    The default source of "main" is page A, which is a frameset of pages B and C. In page B, I want to embed the same controls I have on the main page, and have them affect the main page from there. Here's the controls script from the main page - it works from that page - a resizing onClick of the "player" iframe:

    Code:
    <head>
    <script language="JavaScript">
    function resizeIframe(iframeId, iframeHeight, iframeWidth)
    {
    if (iframeWidth>0)
    {
    document.getElementById(iframeId).style.width=iframeWidth;
    }
    if (iframeHeight>0)
    {
    document.getElementById(iframeId).style.height=iframeHeight;
    }
    }
    </script>
    </head>
    
    <body>
    <a id="widenButton" onclick="resizeIframe(player', 420, 720)return false;">Enlarge Player</a>
    </body>
    How would I put the widenButton in that back page and still have it affect the front page?

    Thanks in advance for any help,
    Miz Parker
    Last edited by Snookerman; 06-25-2009 at 07:53 AM.

Bookmarks

Posting Permissions

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