欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

IFRAME自适应高度 博客分类: Html  

程序员文章站 2024-03-07 11:47:27
...
<script>
function leftHeightAuto(){
document.all["leftFrame"].style.height=document.documentElement.clientHeight-167;
}
</script>

<IFRAME id="leftFrame" name="leftFrame" frameBorder=0 scrolling=auto
src="/view/jsp/share/frame/defaultLeftFramePage.htm"
width="200" style="height:expression(leftHeightAuto())">
</IFRAME>


有关iframe高度设定的问题!
http://bbs.blueidea.com/thread-1357166-1-1.html
<script>
function autoResize()
{
        try
        {
                document.all["test"].style.height=test.document.body.scrollHeight
        }
        catch(e){}
}
</script>

<iframe id=test style="height:expression(1); aho:expression(autoResize())" src="\">



滚动条
让竖条没有:
<body style='overflow:scroll;overflow-y:hidden'> 
</body> 
让横条没有:
<body style='overflow:scroll;overflow-x:hidden'> 
</body> 
两个都去掉?更简单了
<body scroll="no"> 
</body>