瀏覽代碼

修改宽度设置

zhangxc 5 年之前
父節點
當前提交
2dceeefe92
共有 2 個文件被更改,包括 4 次插入7 次删除
  1. 2 2
      src/js/information.js
  2. 2 5
      src/js/staticSearch.js

+ 2 - 2
src/js/information.js

@@ -197,14 +197,14 @@ function downLoadFile() {
 //   });
 // }
 function adjustWidth() {
-  var wt = window.innerWidth;
+  var wt = window.innerWidth || document.documentElement.clientWidth;
   console.log('wt',wt)
   $(".titleH2").width(wt- 0.2*wt -33 - 200 - 17 - 40 -15 + 'px')
   $("pre").width(wt- 0.2*wt -33 - 200 - 17 - 40 -15 + 'px')
 }
 
 function adjustHeight() {
-  var ht = window.innerHeight;
+  var ht = window.innerHeight || document.documentElement.clientHeight;
   $(".content").height(ht - 145 + "px");
 }
 $(window).on('resize', function(){

+ 2 - 5
src/js/staticSearch.js

@@ -125,12 +125,9 @@ function getKnowledgeData(value) {
     })
 }
 
+
 function adjustHeight() {
-    var wt = window.innerWidth;
-    console.log('wt',wt)
-}
-function adjustWidth() {
-    var ht = window.innerHeight;
+    var ht = window.innerHeight  || document.documentElement.clientHeight;
     var ht2 = $(".searchTypeBox").outerHeight(true)
     $(".staticSearchB ul").height(ht - 120 - ht2 + "px");
 }