手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >浏览器窗口加载和大小改变事件示例
浏览器窗口加载和大小改变事件示例
摘要:复制代码代码如下:window.onload=function(){varheight=document.body.clientHeight...

复制代码 代码如下:

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窗口功能指南之在窗口中书写内容

JQuery中DOM加载与事件执行实例分析

网页里控制图片大小的相关代码

浏览器检测JS代码(兼容目前各大主流浏览器)

javascript瀑布流式图片懒加载实例

微信内置浏览器私有接口WeixinJSBridge介绍

详解Wondows下Node.js使用MongoDB的环境配置

网页里控制图片大小的相关代码

Javascript实现div的toggle效果实例分析

JS实现浏览器菜单命令

精品推荐
分类导航