From 593ec3442481302a89e9ab8139badee88b225189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TOP=E7=B3=AF=E7=B1=B3?= <1130395124@qq.com> Date: Thu, 12 Oct 2023 11:43:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5banner?= =?UTF-8?q?=E4=B8=BA=E5=85=A8=E5=B1=8F=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/style.css | 1 - css/style.less | 1 - index.html | 8 ++++++++ js/main.js | 7 ++++--- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/css/style.css b/css/style.css index e9deccf..6641b43 100644 --- a/css/style.css +++ b/css/style.css @@ -222,7 +222,6 @@ justify-content: center; align-items: center; width: 100%; - height: 7.2rem; background-repeat: no-repeat; background-position: center center; background-size: cover; diff --git a/css/style.less b/css/style.less index 3859d9f..293e278 100644 --- a/css/style.less +++ b/css/style.less @@ -283,7 +283,6 @@ justify-content: center; align-items: center; width: 100%; - height: 7.2rem; background-repeat: no-repeat; background-position: center center; background-size: cover; diff --git a/index.html b/index.html index a6b58ac..884b4dc 100644 --- a/index.html +++ b/index.html @@ -121,6 +121,14 @@ + + \ No newline at end of file diff --git a/js/main.js b/js/main.js index 4dc7211..12ac087 100644 --- a/js/main.js +++ b/js/main.js @@ -7,6 +7,7 @@ let isClose = true, heaerMenuGroup = $('.menu-group'), headerMask = $('.menu-mask'), headerMenuBtn = $('.btn-img'), + isMobile = $(window).width() <= 768, currentRem = 0; function getRem() { @@ -20,10 +21,10 @@ function rszcal() { function headerEffect() { let t = $(document).scrollTop(), flag; - if ($(window).width() > 768) { + if (!isMobile) { flag = t > 4 * currentRem; } else { - flag = t > 0.6 * currentRem; + flag = t > 2.5 * currentRem; } if (flag) { header.removeClass('style1').addClass('style2'); @@ -63,7 +64,7 @@ $(function () { $('.header .menu-group').load('../common/header.html'); $('.footer').load('../common/footer.html'); - + header.on('click', '.menu-btn', function () { (isClose == true) ? showMenu() : hideMenu(); });