修改首页banner为全屏展示

This commit is contained in:
TOP糯米 2023-10-12 11:43:22 +08:00
parent 9896fa329a
commit 593ec34424
4 changed files with 12 additions and 5 deletions

View File

@ -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;

View File

@ -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;

View File

@ -121,6 +121,14 @@
<div class="footer"></div>
<script src="js/main.js"></script>
<script>
$(function () {
if (!isMobile) {
$('.main-banner .item').css('height', window.innerHeight + 'px');
}
});
</script>
</body>
</html>

View File

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