亲宝软件园·资讯

展开

浏览器窗口加载和大小改变事件示例

人气:0
复制代码 代码如下:

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";
};

加载全部内容

相关教程
猜你喜欢
用户评论