* * The following data has not been rigorously tested and will be re-tried in future work * *
var dpi = window.devicepixelratio;//Get screen resolution
Alert ("DPI is:" +dpi);
Alert ("$ (window). Height () is:" +$ (window). Height ());
Alert ("Document.body.offsetHeight:" +document.body.offsetheight);
Alert ("Window.innerheight:" +window.innerheight);
Alert ("Document.documentElement.clientHeight:" +document.documentelement.clientheight)
Alert ("Window.screen.availHeight:" +window.screen.availheight);
var currentscreenheight =$ (window). Height ()/dpi; Doesn't seem to need to be divided by DPI, do not know what happened, may be where there is a wrong, and then again
===================================== Split Line ==================================================
Each screen test dpi--$ (window). Height ()--document.body.offsetheight-- Window.innerheight--document.documentelement.clientheight--window.screen.availheight
Google simulation 6 Plus:3 736 736 736 736 736
Google Analog Note3:3 640 640 640 640 640
Google simulation 5:2 568 568 568 568 568
Apple 5 Real machine: 2 460 460 460 460 460 548
Lenovo Real Machine (company, model unknown): 2 640 640 640 640 1280
Meizu Real Machine (company, model unknown): 3 640 640 640 1920
Summary: In this case, the mobile phone side of the dynamic access to height, in addition to the window.screen.availHeight can not be used, all other
Some people say scrollheight|width can also, I have not tried.
The returned value needs to be divided by the phone's DP1
dpi--and height of the various models displayed on Google analog phones and real machines