1 js函数
function adjustFrameHeight(obj) { var doc = obj.document||obj.contentWindow.document; obj.height=doc.documentElement.scrollHeight; }
2 html代码样例
<iframe src="url" onload="adjustFrameHeight(this);"></iframe>
以上代码兼容ie,firefox
function adjustFrameHeight(obj) { var doc = obj.document||obj.contentWindow.document; obj.height=doc.documentElement.scrollHeight; }
<iframe src="url" onload="adjustFrameHeight(this);"></iframe>