Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen boot bsod computer connection crash css dell display driver drivers email error ethernet excel firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition problem router slow software sound spyware trojan usb video virus vista windows windows vista windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
I need to auto-adjust IFRAME heights


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
pyritechips's Avatar
Computer Specs
Distinguished Member with 12,626 posts.
 
Join Date: Jun 2002
Location: Cowtown, against my will
Experience: Wanna-be Daddy
16-Dec-2003, 12:39 PM #1
I need to auto-adjust IFRAME heights
This is my situation. As shown in the diagram below, I have my webpage set up wherein the default page has only the banner section fixed. The content is iframe A, and as an item is selected from the menu, it is loaded into this frame. The content in iframe A is the menu bar and this content does not change.

My problem is that the different pages (items in the menu) all have different heights. I have had to make the two iframe heights = 4000px to make it long enough for my longest page but this leaves long areas of white space when the other shorter pages are loaded.

Is there a way to detect the length of the page being loaded into iframe A and adjust the height value of both iframe A and iframe B accordingly?

Attached Thumbnails
i-need-auto-adjust-iframe-page_layout.jpg  
__________________
The Canadian Group

"Respect is earned; it is not a birthright." - some crusty ol' Pyrite

"The unknown breeds fear.
Fear breeds hatred.
Hatred breeds violence.
Break the cycle of hatred and violence: stop being ignorant and educate yourself." - ?
moebius's Avatar
Computer Specs
Senior Member with 1,765 posts.
 
Join Date: Oct 2003
Location: Dubai, UAE
Experience: sudo give me your money
16-Dec-2003, 12:43 PM #2
i think this can be done with normal frames and page embedding instead of iframes

u can write a autodetect code in jscript, but thats A LOT OF WORK!!! u need to take in font size consideration, user resolution (Windows API), browser, image sizes, layout, everything... might even be impossible. i suggest embedding 2 frames pages. if u dont know how, ill tell you.
__________________
Think for yourself
Question authority
Throughout human history, as our species has faced the frightening, terrorizing fact that we dont know who we are or where were going in this ocean of chaos, its been the authorities, the political, religious, educational authorities who attempted to comfort us by giving us order, rules, regulations, forming in our minds their view of reality. To think for yourself you must question authority and put yourself in a state of vulnerable open-mindedness.
Corrosive's Avatar
Senior Member with 1,074 posts.
 
Join Date: Jan 2003
Location: Scotland
16-Dec-2003, 01:46 PM #3
Personally, I would dump the frames and redo the site using CSS positioning. I used the code attached to this post and have done what I presume you want to do.

If you want to know more about CSS Positioning, www.webmonkey.com is great.
Corrosive's Avatar
Senior Member with 1,074 posts.
 
Join Date: Jan 2003
Location: Scotland
16-Dec-2003, 01:47 PM #4
Forgot to attach it. D'oh! Try that.
Attached Files
File Type: txt positioning.txt (1.0 KB, 213 views)
pyritechips's Avatar
Computer Specs
Distinguished Member with 12,626 posts.
 
Join Date: Jun 2002
Location: Cowtown, against my will
Experience: Wanna-be Daddy
16-Dec-2003, 02:15 PM #5
Well, the reason I used frames is a) ease and speed of loading each menu item and b) ease of changing menu content.

The problem is, I have 9 pages each of 800x600 and 1024x768. That's 18 pages, and growing as I add more. When I had the menu on each page I had to change the code on 18 pages. Now with the frames, one menu serves for all the pages. Now when i make a menu change I have to change it only once.

But I will experiment with your css suggestions. i am willing and ready to expand my css knowledge. Thanks for the suggestions and I will let you know how it works out!
__________________
The Canadian Group

"Respect is earned; it is not a birthright." - some crusty ol' Pyrite

"The unknown breeds fear.
Fear breeds hatred.
Hatred breeds violence.
Break the cycle of hatred and violence: stop being ignorant and educate yourself." - ?
moebius's Avatar
Computer Specs
Senior Member with 1,765 posts.
 
Join Date: Oct 2003
Location: Dubai, UAE
Experience: sudo give me your money
16-Dec-2003, 03:14 PM #6
stick with css, but also try hosting your pages from a dynamic webserber (PHP, CGI ASP...) try www.brinkster.com
Corrosive's Avatar
Senior Member with 1,074 posts.
 
Join Date: Jan 2003
Location: Scotland
17-Dec-2003, 02:40 PM #7
Or do both. If you need to dynamically update the site, most server-side languages will allow you to code some method of updating the pages.

Often, this is a password protected "backstage area", or a page where you can use various forms to add, edit or delete stuff. I've mostly seen them written with ASP but PHP and the like should be able to do the same.

If this isn't avaliable, Macromedia's Contribute program is meant to be very handy. It's like a cut down version of Dreamweaver, with areas "lockable" so that inexperienced coders don't mess anything up. I think it costs around £80.

Anyway, have fun
__________________
"Computer games don't affect kids - I mean, if Pacman affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music."
- Kristian Wilson [Nintendo Executive 1989]

Anyone fancy going out clubbing tonight?
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
17-Dec-2003, 03:56 PM #8
Sorry Jim, my script from AIM isn't working
It was telling me the height of all your pages is 418px ::
pyritechips's Avatar
Computer Specs
Distinguished Member with 12,626 posts.
 
Join Date: Jun 2002
Location: Cowtown, against my will
Experience: Wanna-be Daddy
17-Dec-2003, 05:53 PM #9
Thanks for the suggestions but alternate servers and expensive software are not options.

Hello B:

These are the lines from my main page:

<iframe src ="banner.htm" name="banner" scrolling="no" frameborder="0" width="100%" height="5940">
</iframe>
</td>
<td width="24%" valign="top">
<iframe src ="menu.htm" scrolling="no" frameborder="0" width="100%" height="5940">
</iframe>


As you can see I have set the height of the iframes to 5940px, to accomidate my largest page.

I was looking online to get an idea how this can be done with JS and i found this line. I know it mentions an image but is the actual function of any use?

<script> var height = screen.height - 300; document.write('<img src="nerve.jpg" width="100" height="'+height+'">'); </script>
__________________
The Canadian Group

"Respect is earned; it is not a birthright." - some crusty ol' Pyrite

"The unknown breeds fear.
Fear breeds hatred.
Hatred breeds violence.
Break the cycle of hatred and violence: stop being ignorant and educate yourself." - ?
brendandonhu's Avatar
Distinguished Member with 15,988 posts.
 
Join Date: Jul 2002
Location: Ann Arbor, MI
Experience: Advanced
17-Dec-2003, 06:08 PM #10
That looks like its to resize an image to the users resolution. You could resize an iframe too, but I don't think thats quite what you're after.

btw if you need hosting with php, cgi, or whatever PM me
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:45 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.