网络编程 
首页 > 网络编程 > 浏览文章

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

(编辑:jimmy 日期: 2025/5/16 浏览:3 次 )
复制代码 代码如下:
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";
};
上一篇:flash遮住div问题的正确解决方法
下一篇:js中settimeout方法加参数的使用实例
友情链接:杰晶网络 DDR爱好者之家 南强小屋 黑松山资源网 白云城资源网 网站地图 SiteMap