瀏覽器窗口加載和大小改變事件示例_javascript技巧
來源:懂視網
責編:小采
時間:2020-11-27 21:20:17
瀏覽器窗口加載和大小改變事件示例_javascript技巧
瀏覽器窗口加載和大小改變事件示例_javascript技巧: 代碼如下: window.onload = function() { var height = document.body.clientHeight; document.getElementById(vivS).style.height = (height - 20) + px; document.getElementById(emd).s
導讀瀏覽器窗口加載和大小改變事件示例_javascript技巧: 代碼如下: window.onload = function() { var height = document.body.clientHeight; document.getElementById(vivS).style.height = (height - 20) + px; document.getElementById(emd).s

代碼如下:
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";
};
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
瀏覽器窗口加載和大小改變事件示例_javascript技巧
瀏覽器窗口加載和大小改變事件示例_javascript技巧: 代碼如下: window.onload = function() { var height = document.body.clientHeight; document.getElementById(vivS).style.height = (height - 20) + px; document.getElementById(emd).s