Automatic height on layout

Posted on 2007-12-04
Last Modified: 2008-02-01
I have the following layout with iframes:

Each content page (home, about us, local moves etc) has different height (short content - long content on each one).  How could I make the whole layout adjust to the height of the content so at the bottom you don't see all the blank space?


Question by:Charlesfx9
  • 3
  • 3
LVL 12

Expert Comment

by:Sinoj Sebastian
ID: 20403313
This may help you

"resizeIframe()" is the one that adjust the height of the IFrame
<script type="text/javascript">
function resizeIframe() {
	// Must launched on the body onload event handler for IE
	// Use document.documentElement if you are in Compat mode
	i = parent.document.getElementById(
	iHeight = document.body.scrollHeight = iHeight + 5 + "px"

Open in new window


Author Comment

ID: 20403417
Thanks for the respond,

I've placed the script on the main index that holds everything and nothing happens, I've also placed the script on the content page and nothing happens neither
LVL 12

Accepted Solution

Sinoj Sebastian earned 500 total points
ID: 20403448
Have you looked at the link?
you need place that script in content page and call that funtion onload.
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.


Author Comment

ID: 20403504
I have the script on the content page and I believe I'm calling the function correctly but nothing happens....this is the content page where you can view it's source:

LVL 12

Expert Comment

by:Sinoj Sebastian
ID: 20403664
I see that.
Now I know that your Iframe resize is working
You see large blank space because, it is from content page

I'll check it soon.

Author Comment

ID: 20403704
you're right...there is some space within the page (lot of <br>) but I had to forcely do it so the content will be correctly.  Somehow I have to fix this first to see the automatic height working...

Do you happen to know how I could fix all those spaces? I could place a new question to reward you the points since it maybe consider a new question.....let me know please


Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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 …
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

815 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

8 Experts available now in Live!

Get 1:1 Help Now