Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Get floating frame to fill remaining space

Posted on 2002-04-24
4
453 Views
Last Modified: 2006-11-17
Hi,

I have 3 floating frames on a webpage that split the page into 3 horizontal areas. The first 2 frames are fixed heights but I would like the last frame to fill the remaining height in the window. Does anyone know how to do this?

<IFRAME SRC="TopFrame.html" WIDTH=100% HEIGHT=250 MARGINWIDTH=0 >
<IFRAME NAME="TableHeading" WIDTH=100% HEIGHT=100 noresize>
<IFRAME NAME="MainWindow" WIDTH=100% >

I know that using non-floating frames you can do this in the surrounding FRAMESET (250,100,*) but this doesn’t work for floating frames.

The reason I can’t do this with non-floating frames is that my frame page is called with FORM data and it has some dynamic elements to submit this data to one of the frames.
0
Comment
Question by:AndyReed
  • 2
4 Comments
 
LVL 33

Accepted Solution

by:
knightEknight earned 150 total points
ID: 6965735
<HTML>
<HEAD>
<SCRIPT language='javascript'>

function getX(obj)
{
  return( obj.offsetParent==null ? obj.offsetLeft : obj.offsetLeft+getX(obj.offsetParent) );
}

function getY(obj)
{
  return( obj.offsetParent==null ? obj.offsetTop : obj.offsetTop+getY(obj.offsetParent) );
}

function resize()
{

   var h = document.body.clientHeight
         - (document.all.TopFrame.height*1)
         - (document.all.TableHeading.height*1)
         - getY(document.all.TopFrame)
         - 5;

   document.all.MainWindow.height = h;

}

</script>
</head>
<BODY onLoad='resize();' onresize='resize();'>

<IFRAME NAME="TopFrame"     id="TopFrame"      WIDTH=100%  HEIGHT='200'  SRC="adressen.txt"  MARGINWIDTH=0 />
<IFRAME NAME="TableHeading" id="TableHeading"  WIDTH=100%  HEIGHT='100'  noresize />
<IFRAME NAME="MainWindow"   id="MainWindow"    WIDTH=100% />

</body>
</html>
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 6965738
oops, src for the top frame should be:  SRC="TopFrame.html"
0
 
LVL 4

Expert Comment

by:EricWestbo
ID: 6965770
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">

    if (navigator.appName == 'Netscape' && document.layers != null) {
        wid = window.innerWidth;
        hit = window.innerHeight;
    }

    if (document.all != null){
        wid = document.body.clientWidth;
        hit = document.body.clientHeight;
    }

    var fil = hit - 350;
    document.write('<IFRAME SRC="TopFrame.html" WIDTH=100% HEIGHT=250 MARGINWIDTH=0>');
    document.write('<IFRAME NAME="TableHeading" WIDTH=100% HEIGHT=100 noresize>');
    document.write('<IFRAME NAME="MainWindow" WIDTH=100% HEIGHT=' + fil +'>');

</script>
0
 

Author Comment

by:AndyReed
ID: 6965919
Perfect, thanks knightEknight.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question