【发布时间】:2015-11-12 22:13:26
【问题描述】:
我尝试检查框架“content1”和“content3”是否为空,然后调整它们的大小。
但是每个循环的大小都会改变
window.setInterval(function () {
check();
}, 50);
function check() {
var content1 = document.getElementsByName("content")[0].contentDocument.body;
var content3 = document.getElementsByName("content3")[0].contentDocument.body;
if (isEmpty(content3)) {
if (isEmpty(content1)) setProperties("0px, *, 0px");
else setProperties("35%, *, 0px");
} else setProperties("25%, 40%, 35%");
window.localStorage.clear();
}
function isEmpty(e) {
return (e.offsetWidth != 0);
}
function setProperties(value) {
document.getElementsByTagName("frameset")[1].cols = value;
}
【问题讨论】:
标签: javascript html typeerror