Skip to content

Commit

Permalink
fix jump logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Stan370 committed Jun 6, 2024
1 parent 7faf8d5 commit 8ac3bac
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@
$(".bg-cover").css("background-image", "url(" + bannerUrl + ")");
</script>

<div class="cover-btns">
<a href="#indexCard" class="waves-effect waves-light btn">
<div id="scrollButton" class="cover-btns">
<a href="#articles" class="waves-effect waves-light btn">
<i class="fa fa-angle-double-down"></i>Start
</a>

Expand Down
3 changes: 0 additions & 3 deletions themes/hexo-theme-matery/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ menu:
Contact:
url: /contact
icon: fas fa-comments
Friends:
url: /friends
icon: fas fa-address-book
# 二级菜单写法如下
#Medias:
# icon: fas fa-list
Expand Down
16 changes: 13 additions & 3 deletions themes/hexo-theme-matery/layout/_partial/index-cover.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var coverPostsCount = coverPosts.length;
<div class="container">
<%- partial('_partial/bg-cover-content') %>

<div class="cover-btns">
<div id="scrollButton" class="cover-btns">
<a href="<%=
[theme.dream, theme.video, theme.recommend]
.some(i=>i.enable)? "#indexCard": "#articles"
Expand Down Expand Up @@ -147,9 +147,19 @@ var coverPostsCount = coverPosts.length;
</div>

<script>
$(function () {
$(
function () {
let coverSlider = $('.carousel');
document.getElementById('scrollButton').addEventListener('click', function(event) {
event.preventDefault(); // Prevent the default anchor behavior
// Smoothly scroll to the #articles section
document.querySelector('#articles').scrollIntoView({
behavior: 'smooth'
});
});
//用户触摸轮播自动 restartPlay 是否生效
let initUserPressedOrDraggedActive = false
Expand Down

0 comments on commit 8ac3bac

Please sign in to comment.