By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,379 Members | 1,759 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,379 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a


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.