sizing an inline frame  | |
March 28th, 2007, 12:01 AM
|
#1 (permalink)
| | Mobile Member
Join Date: Apr 2005 Location: S. Central PA
Posts: 3,601
|
Hey all, ive been on and off of here with random questions about inline frame and .asp etc for a site im obligated  to do.. So now i have got the files on this computer (from my work one) and im having a problem with the way things are rendering and navigating in the inline frames. Its like the width isnt the problem of them, but the height is.. You'll see the snippet of code that is giving me all the problems below: Code: <iframe src="includes/main.html" width="100%" id="main" name="main" frameborder="2" height="800" ></iframe> that is where the main windows is loaded (bottom-mid right) If i dont have a height parameter its very small, i can add parameters then for scrollbars, but if i give it a "height='100%'" then the page just doesnt load, but if i give it a fixed pixel it works, but it leaves soo much blank space below, and then you have to keep in consideration different page lengths and different resolutions  Any help would be great with that.
Also if you open the files attached and see the "Club Info" page, when you click the link to open the PDF, i want it to make the browser ask you if you want to open or save the file, not open right up in that iframe, especially if someone doesnt have Adobe Reader, which i will put a link to on there and a warning as well
Any other suggestions on how i should go about doing this site are also welcome, as you will be able to see from the files i have a basic structure and just have to add content.. (alot)
Thanks
__________________ Thinkpad T61 14.1" wide | WinXP Pro | C2D T8300 CPU | 3GB DDR2 | 160GB HDD | AGN & WWAN
Lenovo S10 10.2" LED display | 1.6Ghz Atom CPU | 1GB DDR2 | 1.3mp webcam | B/G WiFi | 160GB HDD
Last edited by ShuckyD : March 28th, 2007 at 12:05 AM.
|
| |
March 28th, 2007, 12:43 AM
|
#2 (permalink)
| | ph34r t3h g04t
Join Date: Oct 2001 Location: Kingsford, MI
Posts: 19,558
|
To my knowledge, and I may not be correct in this, you can not dynamically size an iframe. It's either no height, or a set height. Height is typically not a percentagable setting, since a page's height can be infinite.
There's no way to have the scrollbar hidden except on demand either, IIRC. It's a very limited impliment, though very handy for static layouts.
There may be a way to embed a page within a div tag, but I'm not sure, I've never tried to do it. That way you could use the overflow property to at least hide the scrollbar when it's not needed.
One way that will work is to put the iframe in a div that has the overflow: auto property. You will still have to give the iframe a set height, but if you set the scrolling to no, the scrollbar _should_ only show up when there's too much text to show. You have to set the width property of the iframe properly though, or you'll always have a horizontal scrollbar. |
| |
March 28th, 2007, 07:28 AM
|
#3 (permalink)
| | Mobile Member
Join Date: Apr 2005 Location: S. Central PA
Posts: 3,601
|
is there any better way to do this without iframes that you can think of? Because they still seem to render differently between FF and IE  |
| |
March 28th, 2007, 07:47 AM
|
#4 (permalink)
| | Member
Join Date: Nov 2005 Location: Northern Ireland
Posts: 210
|
Never used iframes, but I have used layers to produce similar effect, if I'm reading correctly. Layers scale dynamically with the viewers resolution, and I'm sure they allow a height percentage to be set as well fixed values.
Never tried to embed a page for it, it was purely for retrieving data from a datebase, and so had to be pretty flexible, especially height wise.
Been a long time since I did it, I'd need to dig out my programs and make a dummy one when I got home to check, but almost sure this will produce the desired look.
__________________
E6400 @ 3Gig | 4Gig Corsair PC6400 @ 800 | P5N-E SLI 650i | HD4850 | 2 x 250 WD2500JS RAID 0 | Samsung 940BW
|
| | | Thread Tools | Search this Thread | | | | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |