How to get the initialization size of Mobile device by JavaScript
This article mainly introduces how to obtain the initialization size of mobile devices by JavaScript, which has a certain reference value. Interested friends can refer to it. I hope you can learn a lot after reading this article.
Get the mobile device initialization size function getInitZoom () {
If (! this._initZoom) {
Var screenWidth = Math.min (screen.height, screen.width)
If (this.isAndroidMobileDevice () & &! this.isNewChromeOnAndroid ()) {
ScreenWidth = screenWidth / window.devicePixelRatio
}
This._initZoom = screenWidth / document.body.offsetWidth
}
Return this._initZoom
} Thank you for reading this article carefully. I hope the article "how to obtain the initialization size of mobile devices" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and follow the industry information channel. More related knowledge is waiting for you to learn!