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(); });