开发者

Why wont this resize of iframe height work?

I have a form on my main page (main.html) with the target set to an iframe on that page. The action of the frame on the main page is a php file. So, the php file displays in the iframe basically.

Now, I have this script in the php file to get height of content:

var x = document.body.scrollHeight;
window.parent.document.getelementbyid("iframe001").style.height=x;

If I alert x, the scrollheight is there, so x IS the scrollheight d开发者_运维技巧efinetely. That part works. But, I cant set that value to the height of the iframe (iframe001).

Any ideas why I cant do this? And how to do it?

Thanks


getelementbyid should be getElementById

also this answer might help you dynamic iframe height depending on PHP content?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜