Martin Honnen wrote:
Prasad wrote:
So Is there any way to change its height from the iframe
itself???????
As said (in de.comp.lang.javascript), for IE/Win you can use
window.resizeTo(someWidth, someHeight)
even on iframe window objects and it will resize the iframe. As for
getting the document height, look into the function you already have, it
is simply a question of accessing the right document properties e.g.
window.resizeTo(document.documentElement.offsetWid th,
document.documentElement.scrollHeight);
I am using a function ...........
function changeHeight()
{
//
window.resizeTodocument.documentElement.offsetWidt h,document.documentElement.scrollHeight);
// window.resizeTo(200,400);
window.resizeTo(document.documentElement.offsetWid th,document.body.scrollHeight);
setTimeout("changeHeight()",1000);
}
its first time called when iframe body is loaded ..
But its behaving very wierd .. the height of the iframe is increasing
and decreasing to some arbitrary value and after some time, an error
that "Access is denied " is being displayed ...
this iframe's domain is different from the parent's domain .....(but i
dont guess its a problem ..)
And i tested this function with a sample iframe in the same domain ..
its working fine... ( )
what could be the problem in the first case ??
where the only problem is that depending on the IE version and the
rendering mode you need to access document.documentElement or document.body.
--
Martin Honnen
http://JavaScript.FAQTs.com/