change to hugo-blog-awesome theme
This commit is contained in:
parent
113e3650f1
commit
15b6142a8e
131 changed files with 5895 additions and 124 deletions
16
themes/hugo-blog-awesome/assets/js/goToTop.js
Normal file
16
themes/hugo-blog-awesome/assets/js/goToTop.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
window.addEventListener('load', () => {
|
||||
const gttButton = document.getElementById("totop");
|
||||
if (!gttButton) return;
|
||||
window.onscroll = () => {
|
||||
if (
|
||||
document.body.scrollTop > 300 ||
|
||||
document.documentElement.scrollTop > 300
|
||||
) {
|
||||
gttButton.style.visibility = "visible";
|
||||
gttButton.style.opacity = "1";
|
||||
} else {
|
||||
gttButton.style.visibility = "hidden";
|
||||
gttButton.style.opacity = "0";
|
||||
}
|
||||
};
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue