PHP
·
发表于 5年以前
·
阅读量:8293
function getZoom() {
var screenWidth =
Math.abs(window.orientation) === 90
? Math.max(screen.height, screen.width)
: Math.min(screen.height, screen.width);
if (this.isAndroidMobileDevice() && !this.isNewChromeOnAndroid()) {
screenWidth = screenWidth / window.devicePixelRatio;
}
var FixViewPortsExperiment =
rendererModel.runningExperiments.FixViewport ||
rendererModel.runningExperiments.fixviewport;
var FixViewPortsExperimentRunning =
FixViewPortsExperiment &&
(FixViewPortsExperiment === "New" || FixViewPortsExperiment === "new");
if (FixViewPortsExperimentRunning) {
return screenWidth / window.innerWidth;
} else {
return screenWidth / document.body.offsetWidth;
}
}