<iframe id="win" height="140" marginheight="0" src="http://www.sdfao.gov.cn/lm/front/main.jsp?sysid=004" frameborder="0" width="100%" name="win" marginwidth="0" scrolling="no" align="top" onload="javascript:document.getElementById('win').style.height = win.document.body.scrollHeight + 20 + 'px';"></iframe>
<script type="text/Javascript">
function reinitIframe(){
var iframe = document.getElementById("win");
try{
var bHeight = iframe.contentWindow.document.body.scrollHeight;
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
var height = Math.max(bHeight, dHeight);
iframe.height = height;
}catch (ex){}
}
window.setInterval("reinitIframe()", 200);
</script>
iframe高度自适应
原创文章标签 iframe 高度自适应 文章分类 前端开发
©著作权归作者所有:来自51CTO博客作者cag2050的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:jquery的if语句
下一篇:div自适应高度height

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
iframe自适应高度
iframe,自适应高度
高度 iframe 自适应 -
iframe js自适应高度
iframe在实际开发中应ndow对象,然后,通过定时器来检测iframe页面的高度变化,来设置父页面的相应容器的高度即可。
html 父页面 javascript -
iframe 的自适应高度
iframe 的自适应高度
ide 自适应高度 javascript