468,315 Members | 1,512 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,315 developers. It's quick & easy.

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

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
Jul 20 '05 #1
1 10602


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

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by MP Multimedia | last post: by
24 posts views Thread by Charles Crume | last post: by
6 posts views Thread by Nancy Carter | last post: by
10 posts views Thread by IntraRELY | last post: by
4 posts views Thread by Fredrik Melin | last post: by
6 posts views Thread by =?Utf-8?B?ZHNoZW1lc2g=?= | last post: by
5 posts views Thread by Yun | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by Teichintx | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.