1. 程式人生 > >asp.net後臺獲取前臺頁面大小

asp.net後臺獲取前臺頁面大小

script blog get fse hidden javascrip tel set 區域

前臺代碼如下:
<input type="hidden" runat="server" value="0" id="txBodyClientHeight" /> <script type="text/javascript"> document.getElementById(‘txBodyClientHeight‘).value = document.body.scrollHeight; </script>

後臺獲取: txBodyClientHeight.Value

網頁可見區域寬: document.body.clientWidth

網頁可見區域高: document.body.clientHeight
網頁可見區域寬: document.body.offsetWidth (包括邊線的寬)
網頁可見區域高: document.body.offsetHeight (包括邊線的高)
網頁正文全文寬: document.body.scrollWidth
網頁正文全文高: document.body.scrollHeight
網頁被卷去的高: document.body.scrollTop
網頁被卷去的左: document.body.scrollLeft
網頁正文部分上: window.screenTop
網頁正文部分左: window.screenLeft
屏幕分辨率的高: window.screen.height
屏幕分辨率的寬: window.screen.width
屏幕可用工作區高度: window.screen.availHeight
屏幕可用工作區寬度: window.screen.availWidth

asp.net後臺獲取前臺頁面大小