Home >Web Front-end >JS Tutorial >Browser window loading and size change event example_javascript skills

Browser window loading and size change event example_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:58:011154browse
复制代码 代码如下:

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";
};
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn