萬盛學電腦網

 萬盛學電腦網 >> 腳本專題 >> javascript >> 浏覽器窗口加載和大小改變事件示例

浏覽器窗口加載和大小改變事件示例

 這篇文章主要介紹了浏覽器窗口加載和大小改變事件,需要的朋友可以參考下

 代碼如下: 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";  };   
copyright © 萬盛學電腦網 all rights reserved