Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q787 Is it possible to resize a frameset?

irt.org | Knowledge Base | JavaScript | Frame | Q787 [ previous next ]

Q787 Is it possible to resize a frameset?

Sean McLeary writes:

Resizing a frameset is possible in Internet Explorer 4+ with the following method:

document.all.<framset name>.rows = "<new row definition>"

The same technique works for columns.

For example, the following form button will resize the columns of the parent frameset:

<form>
<input type="button" value="resize" onClick="parent.document.body.cols='70%,30%'">
</form>

Steve Schneider writes:

Extending the solution provided by Sean McLeary: By using ID tags in frames and framesets allows you to resize or change the contents of nested frames. The code snippet will read the size of both framesets, and the source of one of the nested frames. It will then resize the inner frameset. You could also reset the frame source of the named frame with:

parent.document.all("TopFrame").all("side").src = "NewPage.html"

<html>
<head>
<title>Test</title>
</head>
<frameset id="TopFrame" rows=80,*>
        <frame src="blank.html" name="top" >
        <frameset id="MiddleFrame" cols=160,*>
                <frame src="blank.html" name="side" >
                <frame src="blank.html" name="main" > 
        </frameset>
</frameset>
</html>

- - - - - - - - - - - - - - - - - - - - - - - - - - -

<html>
<head>
<script language="JavaScript"><!--
function go(){

alert("Top Layer Frameset rows: " + parent.document.all("TopFrame").rows);
alert("Next Layer Frameset rows: " + parent.document.all("TopFrame").all("MiddleFrame").cols);
alert("Next Layer Frame Source: " + parent.document.all("TopFrame").all("side").src);
parent.document.all("TopFrame").all("MiddleFrame").cols="220,*";

}

//--></script>

<title>Blank</title>
</head>
<body>
This is a blank page
<input type = "button" value="test" onClick="go();">
</body>
</html>

Feedback on 'Q787 Is it possible to resize a frameset?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.