mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-16 23:16:48 +00:00
右下角悬浮按钮调整
This commit is contained in:
@@ -18,11 +18,11 @@ const JumpToBottomButton = ({ showPercent = false }) => {
|
||||
return <></>
|
||||
}
|
||||
|
||||
const targetRef = typeof window !== 'undefined' ? document.getElementById('wrapper') : undefined
|
||||
const { locale } = useGlobal()
|
||||
const [show, switchShow] = useState(false)
|
||||
const [percent, changePercent] = useState(0)
|
||||
const scrollListener = () => {
|
||||
const targetRef = document.getElementById('wrapper')
|
||||
const clientHeight = targetRef?.clientHeight
|
||||
const scrollY = window.pageYOffset
|
||||
const fullHeight = clientHeight - window.outerHeight
|
||||
@@ -36,6 +36,7 @@ const JumpToBottomButton = ({ showPercent = false }) => {
|
||||
}
|
||||
|
||||
function scrollToBottom () {
|
||||
const targetRef = document.getElementById('wrapper')
|
||||
window.scrollTo({ top: targetRef.clientHeight, behavior: 'smooth' })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user