diff --git a/asserts/css/style.css b/asserts/css/style.css index 6287b08..db09431 100644 --- a/asserts/css/style.css +++ b/asserts/css/style.css @@ -161,6 +161,7 @@ body.no-scroll { position: fixed; top: 0; width: 100%; + max-width: 100vw; transition: all 0.7s; /* 平滑过渡效果 */ background-color: transparent !important; @@ -742,6 +743,7 @@ div { .overview-bg { width: 100%; + max-width: 100vw; float: right; min-height: 50px; margin-bottom: 0px; @@ -766,6 +768,7 @@ div { } .overview-img { + max-width: 100vw; height: 120px; z-index: 90; float: right; @@ -1069,7 +1072,7 @@ body.dark-theme .book:hover { opacity: 1; } -/* 折叠菜单 */ +/* 折叠按钮 */ button { background-color: transparent; cursor: pointer; diff --git a/asserts/js/my.js b/asserts/js/my.js index 3133afd..e3c604f 100644 --- a/asserts/js/my.js +++ b/asserts/js/my.js @@ -149,7 +149,7 @@ window.addEventListener('scroll', function() { - +// read more $(document).ready(function () { $("#readMoreBtn").click(function () { $("#moreContent").toggleClass("hidden"); @@ -200,19 +200,14 @@ $('.book').on('click', function () { }); // 折叠菜单 -document.addEventListener('DOMContentLoaded', function() { - var acc = document.getElementsByClassName("accordion"); - for (let i = 0; i < acc.length; i++) { - acc[i].addEventListener("click", function() { - this.classList.toggle("active"); - var panel = this.nextElementSibling; - if (panel.style.display === "block") { - panel.style.display = "none"; - } else { - panel.style.display = "block"; - } - }); - } + +$(document).ready(function() { + $(".accordion").on("click touchstart", function(e) { + e.preventDefault(); + $(this).toggleClass("active"); + var panel = $(this).next(".panel"); + panel.slideToggle(); + }); }); // team page img hover3D from jquery