Link to home
Start Free TrialLog in
Avatar of kerrj
kerrj

asked on

iframe auto height

I am looking to create a simple set of 3 iframes like the diagram below with A and B being static in height and C is an autofit to the size of the window.

----------------------------
           A   (77px)
----------------------------
           B   (33px)
----------------------------


           C   (auto)


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

I am basically looking to replace old frame code that looked like this....
<body>
    <frameset rows="74,33,*" framespacing="0" border="0" frameborder="0">
          <frame src="A.asp" name="A" scrolling="no" noresize>
          <frame src="B.asp" name="B" scrolling="no" >
          <frame src="C.asp" name="C" scrolling="auto" >
    </frameset>
</body>

to iframes that look something like this...
<body>
<iframe name="A" width="100%" height="74" frameborder="0" scrolling="no" src="A.asp" ></iframe>
<iframe name="B" width="100%" height="33" frameborder="0" scrolling="no" src="B.asp" ></iframe>
<iframe name="C" width="100%" height="100%" frameborder="0" scrolling="auto" src="C.asp" ></iframe>
</body>


I cannot seem to get my height in frame C to work like it did with the traditional frameset where it would autofit to the size of the browser window.  Are there solutions to this?
Thanks,
Jon
Avatar of Saqib Khan
Saqib Khan
Flag of United States of America image

use Tables..

<table width=100% height=100%>

<tr><td height=10%>
<iframe name="A" width="100%" height="100%" frameborder="0" scrolling="no" src="A.asp" ></iframe>
</td><tr>

<tr><td height=10%>
<iframe name="B" width="100%" height="100%" frameborder="0" scrolling="no" src="B.asp" ></iframe>
</td><tr>

<tr><td height=80%>
<iframe name="C" width="100%" height="100%" frameborder="0" scrolling="auto" src="C.asp" ></iframe>

</td><tr>
</table>

Avatar of kerrj
kerrj

ASKER

This did not seem to work for me the height of frame C still does not autosize to fit the bottom of the screen.  Also, I cannot have frames A and B as percentages, they must be exact heights.  I should also point out that I need this to work in IE, no other browsers need to work for this code.
Thanks,
Jon  
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kerrj

ASKER

The content from C still runs past the bottom of the page and you end up with 2 scroll bars on the left.
Avatar of kerrj

ASKER

Sorry, I meant 2 scroll bars on the right.
In my test I have the second most right scroll bar grayed out with the -107 pixel substraction.
Try to subtract more then 107 pixel.
But you CANNOT remove the right most main window scroll bar.

Sorry, it was wrong statement "CANNOT"; you can :-)
Like this:

<body style="border:0; margin:0;"  scroll="no" >

Zvonko have right

But also you can remove iframes scrollbars too..
And with some calculations differences, your iframe should seem as you wish in every browsers