手机不好使啊-_-||
1 函数声明
function reinitIframe() {
var iframe = document.getElementById("ifm1");//ifare=id为ifm1的节点
try {//try{}catch{}有错误会通过catch语句抛出,无误执行try内部代码
var bHeight = iframe.contentWindow.document.body.scrollHeight;
var dHeight = iframe.contentWindow.document.documentElement.scrollHeight//手机不好用,但是怎么看bheight和dheight赋了相同值啊?这两句是赋值,等号右边表示iframe内部窗口高度
var height = Math.max(bHeight, dHeight);//比较两个变量大小,将大的赋值给height
iframe.height = height;//height赋值给iframe
} catch (ex) { }//前面提到的错误抛出
}
window.setInterval("reinitIframe()", 200);上面那个方法每200毫秒刷新一次
话说加分吧 手机不易啊-_-||