获取移动设备初始化大小

5年以前  |  阅读数:382 次  |  编程语言:JavaScript 
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;
}

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8