调整iframe的高度 [英] resize height of iframe

查看:82
本文介绍了调整iframe的高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用i框架,但我想根据content调整iframe的高度.但是问题是框架仅加载一次,并且当包含iframe的页面作为模式弹出窗口打开时,包含iframe的模式弹出窗口没有高度根据内容有任何想法吗?



i am using i frame i want to resize the iframe height according to content.but the thing is frame is loaded only once and when the page containing the iframe is opened as modal pop up, the modal pop containing the iframe does not have the height according to the content any idea ?

推荐答案

u可以尝试此

<iframe id="i1" src="Home.aspx" runat="server"></iframe>
u can try this

<iframe id="i1" src="Home.aspx" runat="server"></iframe>
i1.Attributes.Add("Height","500");




在您的js中尝试此功能.

Hi,

Try this function in your js.

function setIframeHeight(iframeName, IsCallFromIFrame) {

    if (IsCallFromIFrame) {
        iframeEl = parent.document.getElementById(iframeName);
    }
    else {
        iframeEl = document.getElementById ? document.getElementById(iframeName) : document.all ? document.all[iframeName] : null;
    }
    if (iframeEl) {
            iframeEl.style.height =


(文档).height()+ 10 + " ; 返回; } }
(document).height() + 10 + "px"; return; } }



问候,

Anand



Regards,

Anand


这篇关于调整iframe的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆