日期:2014-05-18  浏览次数:20597 次

怎么设置frame的高度 不出现滚动条
请问   如果有个index.jsp页面,我要在里面镶嵌一个iframe,名字为manframe.jsp,请问怎么在index.jsp里设置manframe.jsp的高度为实际manframe.jsp的高度,而不出现滚动条,实际manframe.jsp的高度是变化的。最好给些代码     谢谢

------解决方案--------------------
这些让美工做啊!
iframe滚动条:style= "overflow:hidden; "
manframe.jsp设为100%就好了
------解决方案--------------------
css里面有一个可以设置!具体的忘记了好像就是fix什么的
------解决方案--------------------
<iframe height= "100% " scrolling= "no "> </iframe>
------解决方案--------------------
function iframeAutoFit(){
try{
if(window!=parent){
var a = parent.document.getElementsByTagName( "IFRAME ");
for(var i=0; i <a.length; i++){
if(a[i].contentWindow==window){
var h1=0, h2=0;
a[i].parentNode.style.height = a[i].offsetHeight + "px ";
a[i].style.height = "10px ";
if(document.documentElement&&document.documentElement.scrollHeight)
h1=document.documentElement.scrollHeight;
if(document.body) h2=document.body.scrollHeight;
var h=Math.max(h1, h2);
if(document.all) {h += 4;}
if(window.opera) {h += 1;}
a[i].style.height = a[i].parentNode.style.height = h + "px ";
}
}
}
}
catch (ex){}
}

在页面最后调用下这个js方法就行了
------解决方案--------------------
scrolling=no
------解决方案--------------------
<iframe height= "100% " scrolling= "no "> </iframe>
同意