Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

iFrames Help

Status
Not open for further replies.

foxymorons

Technical User
Joined
Aug 3, 2004
Messages
27
Location
AU
I am using inline frames with the following code:

<div align="center">
<iframe src="index.htm" name="index" width="100%" height="566" align="middle" frameborder="0" scrolling="yes">Please Download A Browser That Supports Inline Frames.</iframe>
</div>

This is the current code I am using, but I have realised that when there is a longer menu, the inline frame dosent expand to fit the space. I tried making the height 100%, but that makes the inline frame disapear totally!

What's going wrong? Any better alternatives to fix this problem?

Thanks in advance
 
What's going wrong?

Nothing - it's all working as the code tells it to.

Any better alternatives to fix this problem?

You could either increase the height of your iframe to account for all possibilities, remove your menu from the iframe, or use JS to dynamically resize the iframe if the menu is bigger than it.

My favourite? Remove the menu from the iframe ;o). Why? because unlike the othert two options, the menu would work fine for people who change their browser font size, and/or who have JS disabled.

Hope this helps,
Dan

 
Ok, firstly, the menu is not in the iframe!

The menu, is in the index page, which is the main page. And because I have some much content, I am using iFrames to help this problem.

The menu is in the index page, not the iframe, i have searched the net, and there are some JS soultions to this common issue, but none work for me!

Thanks in advance!
 
the menu is not in the iframe!

Sorry - I assumed that it was.

The menu, is in the index page
...
The menu is in the index page, not the iframe

Why don't you show us all your code, with the menu. At the moment, you say the menu isn't in the iframe, but then go on to say that it is located in the index page, and (assuming the index page is "index.htm") yet the index page is loaded in the iframe (where the menu apparently isn't!)

I'm confused... So explaining / showing your code might be beneficial to all.

Dan


 
Ok, thanks for that CSS tip, because iframes are really annoying me :P

What is a good example or code for CSS windows?

thanks in advance
 
u can expand the height of the iframe automatically by adding this script at the end:
<script>
resizeTo(document.body.offsetWidth,document.body.offsetHeight)
</script>

Known is handfull, Unknown is worldfull
 
any chance you can explain what you mean by, "adding this script at the end".

what does this mean, at the end of what? the iframe, the body, the head tag?

please help

thanks
 
the html that will be called in the IFRAME

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top