瀏覽器窗口加載和大小改變事件示例
更新時間:2014年02月27日 17:31:29 作者:
這篇文章主要介紹了瀏覽器窗口加載和大小改變事件,需要的朋友可以參考下
復制代碼 代碼如下:
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";
};
相關(guān)文章
用函數(shù)式編程技術(shù)編寫優(yōu)美的 JavaScript
用函數(shù)式編程技術(shù)編寫優(yōu)美的 JavaScript...2006-11-11uniapp改變底部安全區(qū)頂部手機信號時間電池欄顏色樣式
這篇文章主要為大家介紹了uniapp改變底部安全區(qū)頂部手機信號時間電池欄顏色樣式詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2023-03-03