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 ( -