<iframe onload="init()" onreadystatechange="init()" id="main" name="main" src="user_main.asp" frameBorder="0" width="98%" scrolling="no"></iframe>
就是这个的自适应高度函数写的不规范,火狐和ie不兼容,
我是这么改的,50左右找到 function ReSizeiFrame(iframe)
函数替换成这个:
function ReSizeiFrame(iframe)
{
var FF = (navigator.userAgent.indexOf("Firefox")!=-1);
var IE = (navigator.userAgent.indexOf("MSIE")!=-1);
try{
if(iframe && !window.opera)
{
iframe.style.display = "block";
if(iframe.contentDocument && iframe.contentDocument.body.offsetHeight)
{
if (FF){
iframe.height = iframe.contentDocument.body.offsetHeight + FFextraHeight+0;
}
if(IE){
var iheight=iframe.document.body.scrollHeight;
if (iheight<1000)
{iframe.height=800;}
else
{iframe.height=iheight;}
}
}
else if (iframe.Document && iframe.Document.body.scrollHeight)
{
iframe.height = iframe.Document.body.scrollHeight;
alert(iframe.Document.body.scrollHeight);
}
}
}catch(e){}
}