We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5d9e73f commit b452925Copy full SHA for b452925
getZoom.js
@@ -0,0 +1,18 @@
1
+/**
2
+ * @description 获取移动设备最大化大小
3
+ * @author 未知
4
+ */
5
+
6
+function getZoom(){
7
+ var screenWidth = (Math.abs(window.orientation) === 90) ? Math.max(screen.height, screen.width) : Math.min(screen.height, screen.width);
8
+ if(this.isAndroidMobileDevice() && !this.isNewChromeOnAndroid()){
9
+ screenWidth = screenWidth/window.devicePixelRatio;
10
+ }
11
+ var FixViewPortsExperiment = rendererModel.runningExperiments.FixViewport || rendererModel.runningExperiments.fixviewport;
12
+ var FixViewPortsExperimentRunning = FixViewPortsExperiment && (FixViewPortsExperiment === "New" || FixViewPortsExperiment === "new");
13
+ if(FixViewPortsExperimentRunning){
14
+ return screenWidth / window.innerWidth;
15
+ }else{
16
+ return screenWidth / document.body.offsetWidth;
17
18
+}
0 commit comments