huaisianhuang il y a 3 ans
Parent
commit
0468238be1
2 fichiers modifiés avec 9 ajouts et 5 suppressions
  1. 1 1
      index.html
  2. 8 4
      js/index.js

+ 1 - 1
index.html

@@ -2,7 +2,7 @@
 <html lang="zh_TW">
 <head>
     <meta charset="UTF-8">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"">
     <meta http-equiv="X-UA-Compatible" content="ie=edge, Chrome=1">
     <meta http-equiv="Cache-Control" content="no-cache">
     <meta name="copyright" content="2021 © 幸福空間 │ All Rights Reserved.">

+ 8 - 4
js/index.js

@@ -2,7 +2,7 @@
   /* if(screen.width >= 901){
       window.location.href = "https://www2.hhh.com.tw/";   
   } */
-  if(screen.width <= 480) {
+  
     let height = (window.screen.width * 2) / 3;
     console.log(height);
     $('.sec-02 .slide-item').css('height', `${height}px`);
@@ -10,10 +10,10 @@
     console.log(topHeight);
     $('.sec-00 .slide-item').css('height', `${topHeight}px`);
     $('.sec-00 .container-fluid').css('height', `${topHeight}px`);
-  }
+  
 } 
 
-window.addEventListener('resize', reportWindowSize);
+/* window.addEventListener('resize', reportWindowSize);
 
 function reportWindowSize() {
   if(screen.width > 480) {
@@ -21,7 +21,11 @@ function reportWindowSize() {
     $('.sec-00 .slide-item').css('height', `200px`);
     $('.sec-00 .container-fluid').css('height', `200px`);
   }
-}
+} */
+
+$( window ).resize(function() {
+  location.reload();
+});
 
 $(".sec-01__slider").slick({
         dots: true,