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

+ 3 - 3
js/Desktop/Onload.js

@@ -38,7 +38,8 @@ window.onload = function () {
     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);
+    document.body.style.width = realWidth + 'px'
+    document.body.style.height = realHeight + 'px'
     // window.addEventListener('resize', () => {
     //     var realHeight = window.innerHeight
     //     var realWidth = window.innerWidth
@@ -53,9 +54,8 @@ var initViewport = function (height, width) {
     var content = "height=" + height + ",width=" + width + ",initial-scale=1.0,user-scalable=no";
     metaEl.setAttribute('name', 'viewport');
     metaEl.setAttribute('content', content);
-    document.body.style.width = width + 'px'
-    document.body.style.height = height + 'px'
 }
+initViewport(realHeight, realWidth);