Link to home
Start Free TrialLog in
Avatar of Charlesfx9
Charlesfx9

asked on

Automatic height on layout

I have the following layout with iframes:

http://absolutemediaworks.com/clients/newmoversway/

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?

Regards,

Johan.
Avatar of Sinoj Sebastian
Sinoj Sebastian
Flag of India image

This may help you
http://www.diplok.com/1ppl/html/article093.html

"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(window.name)
	iHeight = document.body.scrollHeight
	i.style.height = iHeight + 5 + "px"
}
</script>

Open in new window

Avatar of Charlesfx9
Charlesfx9

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of Sinoj Sebastian
Sinoj Sebastian
Flag of India 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
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:

http://absolutemediaworks.com/clients/newmoversway/images/comercial_moves.html

Hmmm....
I see that.
Now I know that your Iframe resize is working
You see large blank space because, it is from content page
http://absolutemediaworks.com/clients/newmoversway/images/comercial_moves.html

I'll check it soon.
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