范德萨
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
yiqiu
2025-11-24 00:39:32 +08:00
parent 8d8cba048f
commit 75bd4f7cd2
4 changed files with 50 additions and 11 deletions

View File

@@ -562,4 +562,28 @@
<img id="viewer" alt="" style="display: none;">
</div>
<script>
// 回到顶部功能
$(document).ready(function() {
// 点击回到顶部
$("#backTop").click(function () {
$("html, body").animate({ scrollTop: 0 }, 600);
});
// 根据滚动位置显示/隐藏回到顶部按钮
$(window).scroll(function () {
if ($(this).scrollTop() > 300) {
$("#backTop").fadeIn(300);
} else {
$("#backTop").fadeOut(300);
}
});
// 初始化时隐藏回到顶部按钮
if ($(window).scrollTop() <= 300) {
$("#backTop").hide();
}
});
</script>
{include file="footer"}