复制代码 代码如下:
window.onload = function() {
var height = document.body.clientHeight;
document.getElementById("vivS").style.height = (height - 20) + "px";
document.getElementById("emd").style.height = (height - 20) + "px";
document.getElementById("ob").style.height = (height - 20) + "px";
};
window.onresize = function() {
height = document.body.clientHeight;
document.getElementById("vivS").style.height = (height - 20) + "px";
document.getElementById("emd").style.height = (height - 20) + "px";
document.getElementById("ob").style.height = (height - 20) + "px";
};
【浏览器窗口加载和大小改变事件示例】相关文章:
★ Javascript实现div的toggle效果实例分析
★ Javascript递归打印Document层次关系实例分析
★ JavaScript 定时器 SetTimeout之定时刷新窗口和关闭窗口(代码超简单)