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>toggli ng a frame in a frameset</title>
<script type="text/javascript">
function toggleFrame () {
top.leftFrameVi sible = !top.leftFrameV isible;
parent.document .body.cols = top.leftFrameVi sible ? '50%, *' : '0, *';
}
</script>
</head>
<body>
<input type="button" value="toggle left frame"
onclick="toggle Frame();">
</body>
</html>
<html>
<head>
<title>Toggli ng a frame</title>
<script type="text/javascript">
var leftFrameVisibl e = true;
</script>
</head>
<frameset cols="50%, *">
<frame src="test200307 07.html">
<frame src="test200307 07.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/