展会信息港展会大全

浏览器窗口加载和大小改变事件示例
来源:互联网   发布日期:2016-01-27 15:56:39   浏览:2647次  

导读:这篇文章主要介绍了浏览器窗口加载和大小改变事件,需要的朋友可以参考下代码如下:window onload = function() {var height = document body clientHeight;document getElementById(vivS) style height ...

这篇文章主要介绍了浏览器窗口加载和大小改变事件,需要的朋友可以参考下

代码如下:

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

};

赞助本站

人工智能实验室

相关热词: 浏览器 窗口 加载 事件

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港