February 8, 2023

Hexo customizing

BackToTop function

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<script src="https://unpkg.com/[email protected]/dist/vanilla-back-to-top.min.js"></script>
<script>addBackToTop({
diameter: 50, // Button size
backgroundColor: '#000000', // Button background color, mine is black
textColor: '#fff' // Button text ^ color
})</script>

<style>
#back-to-top {
/* border-radius: 0; */ /* Set to 0 make the button square */
opacity: 0.2; /* Lower the number to make the button invisiable */
}
#back-to-top:hover {
opacity: 0.4;
}
</style>


Reference

About this Post

This post is written by Andy, licensed under CC BY-NC 4.0.

#Hexo