Parcourir la source

修改宽度设置

zhangxc il y a 5 ans
Parent
commit
2dceeefe92
2 fichiers modifiés avec 4 ajouts et 7 suppressions
  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");
 }