本文主要是介绍IFrame取消滚动条并且按内容长度显示mht,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
<iframe οnlοad="Javascript:SetWinHeight(this)" id="frame1" name="content1" src="chenGuoZS/7.mht" align="middle" height="100%" frameborder="none" border="0" width="758px" scroll="no"></iframe>
并且使用JS:
function SetWinHeight(obj)
{
var win=obj;
if (document.getElementById){
if (win && !window.opera){
if (win.contentDocument && win.contentDocument.body.offsetHeight)
win.style.height = win.contentDocument.body.offsetHeight;
else if(win.Document && win.Document.body.scrollHeight)
win.style.height = win.Document.body.scrollHeight;
}
}
}
这篇关于IFrame取消滚动条并且按内容长度显示mht的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!