Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

iframe auto height

Posted on 2006-03-01
10
Medium Priority
?
1,504 Views
Last Modified: 2008-01-09
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
0
Comment
Question by:kerrj
[X]
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
10 Comments
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 16077492
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>

0
 

Author Comment

by:kerrj
ID: 16077847
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  
0
 
LVL 63

Accepted Solution

by:
Zvonko earned 2000 total points
ID: 16080163
How about this:

<body style="border:0; margin:0;">
<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>
<script>
var fC = window.frames.C.frameElement;
window.onresize=function(){
 fC.style.height=document.body.clientHeight-107;
}
window.onresize();
</script>
</body>

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:kerrj
ID: 16085136
The content from C still runs past the bottom of the page and you end up with 2 scroll bars on the left.
0
 

Author Comment

by:kerrj
ID: 16085144
Sorry, I meant 2 scroll bars on the right.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 16085416
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.

0
 
LVL 63

Expert Comment

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

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

0
 
LVL 2

Expert Comment

by:MqRy
ID: 16086954
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

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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 how to implement server side field validation and display customized error messages to the client.
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

618 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