本站资源均来自互联网,仅供学习与参考,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
Copyright @ 2015-2020 织梦园 版权所有
Power by DedeCms
鲁ICP备15039853号-1
鲁公网安备 37132302000249号
模板标签 TAG标签 网站地图 XML地图 今日更新 返回顶部
在主页面 iframe onLoad 时间里面写
function iframeLoad()
{
document.getElementById("iframe").height=0;
document.getElementById("iframe").height=document.getElementById("iframe").contentWindow.document.body.scrollHeight;
}
下面是示例代码
<iframe width='100%' id="myiframe"frameborder="0" scrolling="no" onload="changeFrameHeight()" frameborder="0" src="/style/banner/index.html"></iframe>
<script>
function changeFrameHeight(){
document.getElementById("myiframe").height=0;
document.getElementById("myiframe").height=document.getElementById("myiframe").contentWindow.document.body.scrollHeight;
}
window.onresize=function(){
changeFrameHeight();
}
</script>