From 35e2a282d3d85eebf762d34ec3bb48d34dccb939 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Tue, 27 Dec 2022 10:44:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83=E4=BA=A4=E4=BA=92=E3=80=81?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/hexo/components/Header.js | 8 +++++++- themes/matery/components/Header.js | 8 ++++++++ themes/matery/components/HeaderArticle.js | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/themes/hexo/components/Header.js b/themes/hexo/components/Header.js index 67d41347..07d19b20 100644 --- a/themes/hexo/components/Header.js +++ b/themes/hexo/components/Header.js @@ -44,9 +44,15 @@ const Header = props => { } } + /** + * 自动吸附滚动,移动端体验不好暂时关闭 + */ const scrollTrigger = () => { - const scrollS = window.scrollY + if (screen.width <= 768) { + return + } + const scrollS = window.scrollY // 自动滚动 if ((scrollS > windowTop) & (scrollS < window.innerHeight) && !autoScroll ) { diff --git a/themes/matery/components/Header.js b/themes/matery/components/Header.js index 6a66cb5a..627e496d 100644 --- a/themes/matery/components/Header.js +++ b/themes/matery/components/Header.js @@ -43,7 +43,15 @@ const Header = props => { } } + /** + * 吸附滚动,移动端关闭 + * @returns + */ const scrollTrigger = () => { + if (screen.width <= 768) { + return + } + const scrollS = window.scrollY // 自动滚动 diff --git a/themes/matery/components/HeaderArticle.js b/themes/matery/components/HeaderArticle.js index 95a00939..f7c7379d 100644 --- a/themes/matery/components/HeaderArticle.js +++ b/themes/matery/components/HeaderArticle.js @@ -2,7 +2,7 @@ export default function HeaderArticle({ post, siteInfo }) { const headerImage = post?.page_cover ? post?.page_cover : siteInfo?.pageCover const title = post?.title return ( -