//iframe自适应高度
function getheight(id, name) {
document.documentelement.scrolltop = 0;
var ifm = document.getelementbyid(id);
var subweb = document.frames ? document.frames[name].document :
ifm.contentdocument;
if (ifm != null && subweb != null) {
ifm.height = subweb.body.scrollheight;
}
initparentheight(); //这个是再初始化父页面的iframe的高度
}
function initparentheight() //初始化父页面的iframe的高度
{
var div = window.parent.document.getelementbyid('mainframe');
div.style.height=window.document.body.scrollheight||window.document.body.offsetheight+5;
}