Closed Thread Icon

Topic awaiting preservation: Autosizing Iframes Pages that link to <a href="https://ozoneasylum.com/backlink?for=8972" title="Pages that link to Topic awaiting preservation: Autosizing Iframes" rel="nofollow" >Topic awaiting preservation: Autosizing Iframes\

 
Author Thread
enoctis
Obsessive-Compulsive (I) Inmate

From: Atlanta, GA - USA
Insane since: Dec 2003

posted posted 12-20-2003 03:09

I am looking for a script to make an iframe autosize (height-wise) to the content that it contains. I can't seem to find this. Also, the iframe needs to resize upon *content load; not merely when the parent page is loaded.

If anyone could help me, this would be GREATLY appreciated!

-os2

Veneficuz
Paranoid (IV) Inmate

From: A graveyard of dreams
Insane since: Mar 2001

posted posted 12-20-2003 12:23

I haven't used javascript in ages so I don't know how to write the code, but I've got an idea of how it might be done.

To the page you're loading into the iframe add a onload function. Have the onload function calculate the page's height and then send it to a function in the parent window that resizes the iframe.

The question was also posted either here or on the GN a while ago. So if you do a search you should be able to find some code examples for what I said.

_________________________
"There are 10 kinds of people; those who know binary, those who don't and those who start counting at zero"
- the Golden Ratio -

enoctis
Obsessive-Compulsive (I) Inmate

From: Atlanta, GA - USA
Insane since: Dec 2003

posted posted 12-20-2003 14:27

That sounds like a good idea, and I know how to calculate a pages scroll height, but I can't seem to send that information to the parent window. I know this can be done - it's just a matter of finding out how. BTW - I did do a search for the autosizing iframe, but the results didn't contain what I was looking for; they were referring to the scripting for a virtual desktop in DHTML. Thanks though!


-os2

« BackwardsOnwards »

Show Forum Drop Down Menu