用JavaScript 取得螢幕裝置各項數值的指令
- 目前使用範圍的高、寬
 document.documentElement.clientHeight
 document.documentElement.clientWidth
- 網頁可見區域的寬、高
 document.body.clientWidth
 document.body.clientHeight
- 網頁可見區域的寬、高
 document.body.offsetWidth(包括邊線和捲軸的寬)
 document.body.offsetHeight(包括邊線的寬)
- 網頁內容全文的寬、高
 document.body.scrollWidth
 document.body.scrollHeight
- 網頁被捲而隱藏的高(FireFox)  (the number of pixels the body is scrolled) (垂直方向)
 document.body.scrollTop
 網頁被捲而隱藏的高(IE)
 document.documentElement.scrollTop
- 網頁被捲而隱藏的左側  (the number of pixels the body is scrolled) (水平方向)
 document.body.scrollLeft
- 網頁內容(Screen)在網頁視窗(Window)的上緣(y座標)
 window.screenTop
- 網頁內容(Screen)在網頁視窗(Window)的左緣(x座標)
 window.screenLeft
- 螢幕解析度的高、寬 (Ex. 1080*1980)
 window.screen.height
 window.screen.width
- 螢幕可用工作區高、寬  (Ex. 1032*1980)
 window.screen.availHeight
 window.screen.availWidth
- 螢幕的顏色深度(彩色位元數)  (Ex. 24)
 window.screen.colorDepth
- 螢幕的像素深度(像素位元數)  (Ex. 24)
 window.screen.pixelDepth
- 螢幕的X、Y方向解析度(像素/英寸)
 window.screen.deviceXDPI
 window.screen.deviceYDPI
- 螢幕的X、Y方向邏輯解析度(像素/英寸)
 window.screen.logicalXDPI
 window.screen.logicalYDPI
- window.screen.bufferDepth
- window.screen.fontSmoothingEnabled
- window.screen.updateInterval
 
 
沒有留言:
張貼留言