Forum Moderators: open

Message Too Old, No Replies

Iframe resizing script doesn't work in IE mac or Windows either?

iframe resizing problem in IE mac

         

Goiaba

12:25 pm on Aug 9, 2004 (gmt 0)

10+ Year Member



Hi,

I found a script in Dynamic Drive that resizes an iframe according to the content that I can AVOID UGLY scrollbars that won't fit the page design. The script should work also after the page has downloaded and then you click a link that brings a new content to your iframe.

The script works properly in mac with Safari, also with Netscape and Mozilla. Firefox adds a scrollbar for some reason even if it is defined in the page code scrolling="no". I have tested the page in Windows only with Explorer and there resizing works only if you refresh the page (otherwise it cuts the content). That's not good for two reasons: the end-user won't know to refresh it and on the other hand I have a dynamic menu tree that closes in refresh and the user is not able to change the iframe content anyway.

In mac IE I have a problem that the iframe won't resize and the information content in my iframe is cut away, in the part that should be resized.

Is there any way to change "the resizing iframe code" so that it would work in IE as well? Or is there another cross-browser way to resize the iframe according to content height?

Goiaba

[edited by: tedster at 3:02 am (utc) on Aug. 10, 2004]
[edit reason] remove link [/edit]

tedster

3:01 am on Aug 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forum, Goiaba.

If I read your request properly, the script works on IE Windows (it seems to anyway) but not IE Macintosh, right?

And in fact, that script does not even work as advertised in Netscape, Mozilla or Opera on a PC either. It's close, but close doesn't count when you're trying to eliminate a scrollbar cross-browser.

We really don't have the legal right to copy that script here and work on it - and that may well be a job you need to hire someone to do, at any rate. So I am removing the link to the exact script so we don't get into any trouble.

But maybe this thread is not a total washout - does anyone have an approach to dynamically resizing the height of an iframe?

Goiaba

7:53 am on Aug 10, 2004 (gmt 0)

10+ Year Member



Yes, it works in Windows IE if I refresh the page (atleast in my Windows 2000, IE it is like that).

It would be a cool script since the iframe scrollbars are not nice to use and they can't be even modified (except only for Windows IE that is not enough).

tedster

12:44 pm on Aug 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It would be a very sweet script - but it depends very much on how each browser displays the font. You may have noticed that IE on a pc, for instance, tends to spread the letters out more than, say Opera.

And so the line breaks fall in different spots and the same document with the same stylesheet can take up more space on one browser than another.

It's a heck of a job to get the actual height of the iframed content in pixels, and then adjust the iframe height dynamically. I'm pretty sure the iframed document would need to be on the same domain, but that will most likely be the case, I'd assume.

vixnfox

4:46 pm on Aug 28, 2004 (gmt 0)

10+ Year Member



Hi,
thats the same script I am using. I couldnt get mine to work in Netscape 6, but it works on IE Mac 5 (or did when I last looked).In the end I just checked for Netscape and style.heighted to 900px(fits all my pages)
all the sidebar menus open in the centre <div><iframe>
Hope this helps. I did email the author of the script and he corrected a line which was filling up the event queue and crashing.

vixnfox

[edited by: DrDoc at 11:55 pm (utc) on Aug. 30, 2004]
[edit reason] No URLs, thanks. See TOS [WebmasterWorld.com] [/edit]

vixnfox

3:49 am on Aug 31, 2004 (gmt 0)

10+ Year Member



Hmmm.... i posted the URL because you said you cannot post the code!?!?!? Dont see how you can help unless you can actually post the code. :)

vixnfox

vixnfox

3:52 am on Aug 31, 2004 (gmt 0)

10+ Year Member



...btw the URL was a link to my own domain