Forum Moderators: open

Message Too Old, No Replies

Dynamically Resizing Frames - HELP!

         

kwong007

1:25 am on Nov 21, 2003 (gmt 0)

10+ Year Member



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...; 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>

Iguana

6:01 pm on Nov 25, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Has nobody tried to help you - apologies I started reading some Google update thread and it's taken me 4 days and just left me promising never to read another update thread

Welcome to Webmasterworld.

Regarding your code - has something been lost in the copy and paste? I would expect to see:

frames["main"].frames["body"]

as the syntax for referring to frames and their contents. If that really is the code you are using then try it with the brackets

kwong007

5:51 pm on Nov 26, 2003 (gmt 0)

10+ Year Member



Thanks for the info. I really appreciate your response. The code posted was not my own and I was having difficulty modifying it. Either way, I decided to implement my own solution and it worked! Either way, thanks bunches