现在的位置: 首页 > 综合 > 正文

iframe 自动调整高度js

2017年12月25日 ⁄ 综合 ⁄ 共 470字 ⁄ 字号 评论关闭
<iframe id="card" name="card" onload="SetFrameHeight(this)" frameborder="0"  scrolling="no" style="width: 100%;border: 0px;" src="card.do?memberNo=${travelor.memberNo}">
</iframe>

	function SetFrameHeight(obj){
		var win=obj;
		if (document.getElementById){
			if (win && !window.opera){
				if (win.contentDocument && win.contentDocument.body.offsetHeight){
					win.height = win.contentDocument.body.offsetHeight;
				}else if(win.Document && win.Document.body.scrollHeight){
					win.height = win.Document.body.scrollHeight;
				}
			}
		}
	} 

抱歉!评论已关闭.