Home >php教程 >php手册 >iframe 框架自动适应高度

iframe 框架自动适应高度

WBOY
WBOYOriginal
2016-06-06 20:00:481231browse

function reinitIframe(){ var iframe = document.getElementById(frame_content); try{ var bHeight = iframe.contentWindow.document.body.scrollHeight; var dHeight = iframe.contentWindow.document.documentElement.scrollHeight; var height = Math.m

function reinitIframe(){
var iframe = document.getElementById("frame_content");
try{
var bHeight = iframe.contentWindow.document.body.scrollHeight;
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
var height = Math.max(bHeight, dHeight);
iframe.height =  height;
}
catch (ex){}
}
window.setInterval("reinitIframe()", 200);

 

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php 生成缩略图Next article:何清除MSSQL事务日志文件