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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

javascript resizing html frame.

Status
Not open for further replies.

caesarkim

Programmer
Oct 30, 2003
56
US
I have 4 frames. I want one of the frames to be resized automatically when I resize one frame.

for example, if I resize "middle" frame, like scrolling up or down, then I want "bottom" frame to be resized automatically. I want the consistent size of the frame on a user's resize event. does anybody know any resource or function to do this?

It would be great if somebody can teach me how to do it.

Thanks.


<html>
<head>
<title>My Frames Page</title>
</head>

<script language="javascript">

function resizeFrame(page)
{
// resize bottom frame.
}

</script>

<frameset cols="120,*">
<frame src="menupage.html" name="menu">
<frameset rows="*,60,50">
<frame src="welcomepage.html" name="main">
<frame src="middle.html" name="middle" onresize="resizeFrame(this)">
<frame src="bottombanner.html" name="bottom">
</frameset>
</frameset>

</html>
 
I'm not sure why you need Javascript to do this. If you want the bottom frame to resize when the top frame is resized, give it a height of "*" instead of "50".

Maybe I've mis-understood your question... although when you say that you want to resize a frame by scrolling, you can see how I might be confused.

Hope this helps,
Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
It sounds like you want to keep the bottom two frames in proportion with each other. Is that right? You probably don't need to use JavaScript. If I understand you right, nested framesets could achieve the effect you're looking for:
Code:
<html>
<head>
<title>My Frames Page</title>
</head>

<frameset cols="120,*">
<frame src="menupage.html" name="menu">
<frameset rows="*,110"> 
<frame src="welcomepage.html" name="main">
<frame src="[b]bottomframeset.html[/b]" name="[b]bottomframeset[/b]">
</frameset> 
</frameset>

</html>

Then in "bottomframeset.html"...
Code:
<html>
<frameset rows="60%,*"> 
<frame src="middle.html" name="middle">
<frame src="bottombanner.html" name="bottom">
</frameset> 
</html>

If you still want to use JavaScript start here, and come back here if you run into problems.

Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top