iframe自適應高度詳解

主頁面代碼示例:javascript

<iframe id="frame_content" src="iframe_b.html" scrolling="no" frameborder="0"></iframe>html

<script type="text/javascript">
function reinitIframe(){
var iframe = document.getElementById("frame_content");
try{
iframe.height =  iframe.contentWindow.document.documentElement.scrollHeight;
}catch (ex){}
}
window.setInterval("reinitIframe()", 200);
</script>java

 

原文出處:http://bbs.blueidea.com/thread-2902341-1-1.htmlide

相關文章
相關標籤/搜索