culda_a wrote:to bad that this post is not in english
English? OK, I'll do my very best, Miss Sophie:
Hello!
Old thread, current problem:
This script, like the one chip_rider posted works (in Firefox as well), if I use it to resize an iframe, displaying a "simple" html-page.
But if I use it (with FF) to resize an iframe displaying a page built with css and many divs, the script seems to have problems to get the actual height of the page, useing "document.getElementById('iframename').contentWindow.document.body.scrollHeight". The Internet Explorer has no problems.
Now the answer is: So, code your page in a proper way, according to the standards, dumbass.
Yes Sir, but the PHP-Script I want to display in the iframe is part of an other complex cms, which I did not write. (And I would not nearly be able to do so.) So I have limited control of the pagedesign.
So here is my idea (considering, that I have NO idea about javascript):
I don't know how the script gets the height of the document in the iframe "iframename"... (contentWindow.document.body.scrollHeight ?) Does it read the <body> of the page to display? I tried to give the <body> of the page a fixed height and then the script works well. But if it doesn't work "automatically", when no fixed height of the <body> is given, is it possible to modify the javascript, so that it reads another specific element of the page in the iframe? In this case this element would be a div named "content". It's height would be the right height to resize the iframe to.
So in short form: Is it possible to use javascript to get the height of a specific DIV of the page in the iframe, to use it in oder to resize the iframe?
ps: There would also be the possibility to modify the template of the cms, displayed in the iframe and to place a javascript there which does the job and hands the var to a script that resizes the iframe if this is the way it has to be done.
I am very curious if there is a solution and say thank you for answers and for your concern.
Vuk