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

J

JP

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
 
M

Martin Honnen

JP said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,829
Latest member
PIXThurman

Latest Threads

Top