在做企業微信的時候,做各種機型兼容問題的時候 , 對於不同的分辨率手機,頁面顯示不美觀
window.screen.availWidth 返回當前屏幕寬度(空白空間)
window.screen.availHeight 返回當前屏幕高度(空白空間)
window.screen.width 返回當前屏幕寬度(分辨率值)
window.screen.height 返回當前屏幕高度(分辨率值)
window.document.body.offsetHeight 返回當前網頁高度
window.document.body.offsetWidth 返回當前網頁寬度
手機的物理分辨率 (乘以像素比)
//alert(screen.availHeight * window.devicePixelRatio); //alert(screen.availWidth * window.devicePixelRatio);