lsc 2 years ago
parent
commit
df1a66b86e
1 changed files with 3 additions and 2 deletions
  1. 3 2
      js/Desktop/Onload.js

+ 3 - 2
js/Desktop/Onload.js

@@ -36,6 +36,8 @@ window.onload = function () {
     U.MD.U.L.login();
     //U.MD.D.isLogin();
     U.MD.D.fullscreen();
+    var realHeight = window.innerHeight > window.innerWidth ? window.innerWidth : window.innerHeight
+    var realWidth = window.innerHeight > window.innerWidth ? window.innerHeight : window.innerWidth
     initViewport(realHeight, realWidth);
     // window.addEventListener('resize', () => {
     //     var realHeight = window.innerHeight
@@ -54,8 +56,7 @@ var initViewport = function (height, width) {
     document.body.style.width = width + 'px'
     document.body.style.height = height + 'px'
 }
-var realHeight = window.innerHeight > window.innerWidth ? window.innerWidth : window.innerHeight
-var realWidth = window.innerHeight > window.innerWidth ? window.innerHeight : window.innerWidth
+
 
 
 US.Config = {