1个回答
展开全部
//页面自适应
function iFrameHeight() {
var ifm = document.getElementById("ifbox");
var subWeb = document.frames ? document.frames["ifbox"].document : ifm.contentDocument;
if (ifm != null && subWeb != null) {
ifm.height = subWeb.body.scrollHeight;
}
}
<iframe onload="javascript:iFrameHeight()" name="ifbox" src="" scrolling="no" width="550"
frameborder="0" id="ifbox"></iframe>
function iFrameHeight() {
var ifm = document.getElementById("ifbox");
var subWeb = document.frames ? document.frames["ifbox"].document : ifm.contentDocument;
if (ifm != null && subWeb != null) {
ifm.height = subWeb.body.scrollHeight;
}
}
<iframe onload="javascript:iFrameHeight()" name="ifbox" src="" scrolling="no" width="550"
frameborder="0" id="ifbox"></iframe>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询