+ -
当前位置:首页 → 问答吧 → 谁帮我看一下iframe兼容问题IE6正常火狐和IE8不正常!

谁帮我看一下iframe兼容问题IE6正常火狐和IE8不正常!

时间:2010-06-03

来源:互联网

谁帮我看一下iframe兼容问题,在IE6很正常的显示。
2.jpg (52.94 KB)
2010-6-3 14:56

不过用火狐就不行了。
1.jpg (41.18 KB)
2010-6-3 14:56

<iframe src="details.html" onresize="reSize()" id="ifrm" frameborder="0" scrolling="No"  align="top"></iframe>

//JS iframe自适应高度宽度
function reSize()
{
       try{       
       var oBody       =       ifrm.document.body;
       var oFrame       =       document.all("ifrm");
              
       oFrame.style.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
       oFrame.style.width = oBody.scrollWidth + (oBody.offsetWidth - oBody.clientWidth);
       }
       //An error is raised if the IFrame domain != its container's domain
       catch(e)
       {
       window.status =       'Error: ' + e.number + '; ' + e.description;
       }
}

作者: xiaoru2009   发布时间: 2010-06-03