博客列表顶部边距;
悬浮百分比负数异常;
标签文字不换行;
背景色不当;
This commit is contained in:
tangly
2021-11-07 09:21:34 +08:00
parent 60c3b652f9
commit e3423f9768
5 changed files with 13 additions and 11 deletions

View File

@@ -18,12 +18,14 @@ const JumpToTopButton = ({ targetRef, showPercent = true }) => {
const clientHeight = targetRef ? (targetRef.current ? targetRef.current.clientHeight : 0) : 0
const scrollY = window.pageYOffset
const fullHeight = clientHeight - window.outerHeight
const shouldShow = scrollY > 100
let per = parseFloat(((scrollY / fullHeight * 100)).toFixed(0))
if (per > 100) per = 100
const shouldShow = scrollY > 100 && per > 0
if (shouldShow !== show) {
switchShow(shouldShow)
}
let per = parseFloat(((scrollY / fullHeight * 100)).toFixed(0))
if (per > 100) per = 100
changePercent(per)
}
useEffect(() => {