shaogen1995 пре 5 месеци
родитељ
комит
20fb969189
1 измењених фајлова са 12 додато и 0 уклоњено
  1. 12 0
      展示端/public/home.html

+ 12 - 0
展示端/public/home.html

@@ -80,6 +80,18 @@
     </div>
   </body>
   <script>
+    //----- 图片还未加载出来,高度为0,点击按钮错位问题
+
+    // 1.获取屏幕的宽度
+    const pageWidth = window.innerWidth >= 500 ? 500 : window.innerWidth
+
+    // 顶部 图片的 宽高比为 1:0.92
+
+    // 计算出图片的高度为
+    const imgHeight = Math.round(pageWidth * 0.92)
+
+    document.querySelector('.top').style.height = imgHeight + 'px'
+
     const url1Dom = document.querySelector('#url1')
     url1Dom.onclick = () => {
       window.location.href = '/web/#/exhi'