您的位置:首页 > 其它

Iframe自动适应高度

2007-07-10 11:39 417 查看
var ifrm = document.getElementById("Iframe_com");
ifrm.src=url;
ifrm.className="vis1";
ifrm.style.height=ifrm.document.body.scrollHeight+1+"px";

又或者
function Iframe_com_onload()
{
document.all.Iframe_com.style.height=(Iframe_com.document.body.scrollHeight+50)+"px";
window.scrollTo(0,0);
}
<iframe id="Iframe_com" frameborder="0" width="100%"
onload="Iframe_com_onload();"></iframe>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: