1. 程式人生 > >瀏覽器窗口問題

瀏覽器窗口問題

.get school window style wid 適應 添加 單位 client

Window 尺寸 (可以參考w3cSchool BOM 對象) var w=window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; var h=window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; 適應多個瀏覽器。在給對象賦值時需要添加px單位如下 document.getElementById("divHeightDynamicValue").style.height=h.toString()+"px"; js元素.style.屬性;

瀏覽器窗口問題