Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Resize Frame based on Content 1

Status
Not open for further replies.

windycity1

Technical User
Feb 20, 2005
5
US
Is is possible to resize a frame within a frameset when a page is loaded into the frame? I load two different pages into the same frame (for different functions) and need the frame to resize to be larger for one of the pages.
 

You sure can. Give your frameset an id:

Code:
<html>
	<frameset id="myFrameset" rows="50%,50%">
		<frame src="file.html"></frame>
		<frame src="about:blank"></frame>
	</frameset>
</html>

and then use getElementById in your frame code:

Code:
<html>
<body onload="parent.document.getElementById('myFrameset').setAttribute('rows', '75%,25%', 0);">
</body>
</html>

Hope this helps,
Dan


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top