K
Kevin
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>
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>