Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

Using Iframes

Posted 16 Oct 2006 18:30:01
1
has voted
16 Oct 2006 18:30:01 Kyle Christy posted:
I just put an iframe into a table's cell in my webpage. It's all working fine, I was just wondering if there was any way I could get the iframe to automatically expand the cell downward so I didn't have to use the scrollbars in the iframe. If there isn't is there any other method of getting this effect?

Replies

Replied 17 Oct 2006 06:17:18
17 Oct 2006 06:17:18 micah santos replied:
i've been working with iframes before.... unfortunately, i got no solution for this kind of problem. i even looked at iframes properties.

however, on of the few things i've learned about using iframes is, i only use it when there's a fix height/width size.
Replied 20 Oct 2006 01:54:23
20 Oct 2006 01:54:23 Mike Mitchell replied:
Sorry, but I'm not 100% sure what effect you're trying to achieve. Do you mean you want it to auto expand based on the content of the file that's in the IFRAME? So it's 50 pixels tall when there's only two lines of text, and 500 pixels tall when there's 10 lines of text?

This is actually possible, but probably MUCH more difficult and time consuming than it would be worth.

You would need to something inside the IFRAME file to tell you how tall (and/or wide) it is. Some type of graphic or table that has height/width properties would be ideal. Then you could use Javascrit to pass those variables to the outer frameset and see if you could modify the IFRAME height with a change to its CSS properties (if that's even possible -- I'm sorry that I'm too busy to build a test page and check this out). If you can't do that, you would need to load the IFRAME content first, scan it for the hight indicator (which could be a Javascript variable, or the aforementioned table/image height) then immediately redirect to the real page, passing the variable along (either using a hidden frameset or URL parameter to share the variable). And then the page hosting the IFRAME could use that variable to specify the height of the IFRAME.

If this sounds complicated... it is! This is possible, but it would be very complicated and time consuming to do.

Good luck

Reply to this topic