Dynamically Resizing Frames Help

Discussion in 'HTML' started by Kevin, Nov 21, 2003.

  1. Kevin

    Kevin Guest

    Hello,

    I am working on a implementation that dynamically resizes frames based
    off a client trigger. (in this case a textbox)
    The implementation has nested framesets.

    The javascript isnt working.

    If there is anyone that can help me, I would greatly appreciate it.

    There are four files.
    1) Page1.htm - the main document

    2) adbar.htm - a frame

    3) main.htm - bottom frame - is a frameset that holds two additional
    frames

    4) contents.htm - a bottom frame

    5) main.htm - a bottom frame that is resized dynamically

    adbar.htm
    --------------
    <HTML>
    <TITLE>Sizing Framesets</TITLE>
    <SCRIPT>
    var hidden = false //Tracks the state

    function buildFrameset(state) {
    var str = "<TITLE>PSB Test</TITLE>"
    // Get the main document being displayed
    if (frames["main"].frames.length!=0)
    bodyLoc = frames["main"].frames["body"].location.href
    else
    bodyLoc = frames["main"].location.href
    if (state) {
    // Display the frameset with the table of contents
    str+="<FRAMESET COLS='200,*'>"
    str+="<FRAME SRC='contents.htm'>"
    str+="<FRAME SRC='"+bodyLoc+"' name=body>"
    str+="</FRAMESET>"
    frames["main"].document.open()
    frames["main"].document.write(str)
    frames["main"].document.close()
    } else
    // Do not display the frameset
    frames["main"].location.href = bodyLoc
    hidden = !(hidden)
    }

    function testCheckbox() {
    // Initialize state
    hidden = (frames["main"].frames.length!=0)
    // Make sure frame exists
    if (frames["main"].frames["body"].document.forms["f1"]!=null)
    frames["main"].frames["body"].document.forms["f1"].elements["c1"].checked
    = hidden
    }

    window.onload=testCheckbox; </SCRIPT>
    <FRAMESET ROWS='120,*' onLOAD="testCheckbox()">
    <FRAME SRC='adbar.htm' name=header>
    <FRAME SRC='main.htm' NAME=main>
    </FRAMESET>
    </HTML>

    adbar.htm
    -----------
    <HTML>
    <TITLE>Cross-Browser Pop-up Frames</TITLE>

    <BODY>

    </BODY>
    </HTML>

    main.htm
    -------------
    <HTML>
    <TITLE>Article on sizing framesets</TITLE>
    <FRAMESET COLS='200,*'>
    <FRAME SRC='contents.htm'>
    <FRAME SRC='body.htm' name=body>
    </FRAMESET><noframes></noframes>
    </HTML>

    contents.htm
    ------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    </head>

    <body>
    <object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
    width="800" height="216">
    <param name="movie" value="splash.swf">
    <param name="quality" value="high">
    <embed src="splash.swf" quality="high"
    pluginspage="http://www.macromedia.com/go/getflashplayer"
    type="application/x-shockwave-flash" width="800"
    height="216"></embed></object>
    contents
    </body>
    </html>

    main.htm
    -----------
    <HTML>
    <TITLE>Article on sizing framesets</TITLE>
    <FRAMESET COLS='200,*'>
    <FRAME SRC='contents.htm'>
    <FRAME SRC='body.htm' name=body>
    </FRAMESET><noframes></noframes>
    </HTML>
    Kevin, Nov 21, 2003
    #1
    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. Ernie Sty
    Replies:
    5
    Views:
    2,293
    Ernie Sty
    Oct 2, 2004
  2. JP
    Replies:
    1
    Views:
    460
    Martin Honnen
    Jul 7, 2003
  3. Andy Steady

    Resizing Frames

    Andy Steady, Sep 26, 2003, in forum: Javascript
    Replies:
    0
    Views:
    74
    Andy Steady
    Sep 26, 2003
  4. Pil (Trustworthy from Experience)

    Resizing a div by resizing its borders

    Pil (Trustworthy from Experience), Apr 18, 2009, in forum: Javascript
    Replies:
    9
    Views:
    346
    Proper
    Apr 21, 2009
  5. Proper
    Replies:
    0
    Views:
    196
    Proper
    Apr 18, 2009
Loading...

Share This Page