Dynamically changing frameset layout (closing frames, reopening frames, etc)

Discussion in 'Javascript' started by JP, Jul 7, 2003.

  1. JP

    JP Guest

    Hi,

    How can I create a dynamic frameset whose content changes based on
    user inputs?

    Specifically, how do I toggle a frame within a frameset? How can I
    allow a user to "close" or "dock" a frame by clicking on some button
    and let the parent update its frameset layout?

    What I've been trying to do is for the child frame to send a message
    to the parent, noting that a "close" event is issued, and parent
    updates the frameset html... however that's just not working out, as
    in I cannot seem to modify *only* the frameset parts... the whole
    parent page seems to lose out (so other variables within the parent
    page are lost with the new frameset html).

    How can I achieve a frameset that allows docking frames??

    Thank you,

    -jp
    JP, Jul 7, 2003
    #1
    1. Advertising

  2. Re: Dynamically changing frameset layout (closing frames, reopeningframes, etc)

    JP wrote:
    > Hi,
    >
    > How can I create a dynamic frameset whose content changes based on
    > user inputs?
    >
    > Specifically, how do I toggle a frame within a frameset? How can I
    > allow a user to "close" or "dock" a frame by clicking on some button
    > and let the parent update its frameset layout?
    >
    > What I've been trying to do is for the child frame to send a message
    > to the parent, noting that a "close" event is issued, and parent
    > updates the frameset html... however that's just not working out, as
    > in I cannot seem to modify *only* the frameset parts... the whole
    > parent page seems to lose out (so other variables within the parent
    > page are lost with the new frameset html).
    >
    > How can I achieve a frameset that allows docking frames??


    With IE6/Win and with Netscape 7 the following allows showing/hiding the
    left frame:

    <html>
    <head>
    <title>toggling a frame in a frameset</title>
    <script type="text/javascript">
    function toggleFrame () {
    top.leftFrameVisible = !top.leftFrameVisible;
    parent.document.body.cols = top.leftFrameVisible ? '50%, *' : '0, *';
    }
    </script>
    </head>
    <body>
    <input type="button" value="toggle left frame"
    onclick="toggleFrame();">
    </body>
    </html>

    <html>
    <head>
    <title>Toggling a frame</title>
    <script type="text/javascript">
    var leftFrameVisible = true;
    </script>
    </head>
    <frameset cols="50%, *">
    <frame src="test20030707.html">
    <frame src="test20030707.html">
    </frameset>
    </html>

    As far as I remember it doesn't work with Netscape 6 as the dynamic
    change of rows/cols has been implemented later.
    And it doesn't work with Opera 7, the frame size is not changed at all.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jul 7, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    563
    John Timney \(MVP\)
    Jun 19, 2006
  2. Kevin Walzer

    Re: PIL (etc etc etc) on OS X

    Kevin Walzer, Aug 1, 2008, in forum: Python
    Replies:
    4
    Views:
    371
    Fredrik Lundh
    Aug 13, 2008
  3. Julius Mong
    Replies:
    1
    Views:
    365
    Randy Webb
    May 10, 2004
  4. Joseph Ellis
    Replies:
    1
    Views:
    102
    Tassilo v. Parseval
    Jul 25, 2003
  5. Yun

    Dynamically add frames to frameset

    Yun, Nov 7, 2008, in forum: Javascript
    Replies:
    6
    Views:
    97
    Stefan Z Camilleri
    Nov 7, 2008
Loading...

Share This Page