Solved

Get floating frame to fill remaining space

Posted on 2002-04-24
4
450 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to create a tile layout 1 38
spacing 5 56
Scrolling the scrollbar in a list in html 9 48
Retrieve values of an HTML form using JQUERY 2 38
Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now