mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-06 23:16:52 +00:00
fix jump
This commit is contained in:
@@ -149,9 +149,11 @@ const processGalleryImg = zoom => {
|
|||||||
const autoScrollToHash = () => {
|
const autoScrollToHash = () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// 跳转到指定标题
|
// 跳转到指定标题
|
||||||
const needToJumpToTitle = window.location.hash
|
const hash = window?.location?.hash
|
||||||
|
const needToJumpToTitle = hash && hash > 0
|
||||||
if (needToJumpToTitle) {
|
if (needToJumpToTitle) {
|
||||||
const tocNode = document.getElementById(window.location.hash.substring(1))
|
console.log('jump to hash', hash)
|
||||||
|
const tocNode = document.getElementById(hash.substring(1))
|
||||||
if (tocNode && tocNode?.className?.indexOf('notion') > -1) {
|
if (tocNode && tocNode?.className?.indexOf('notion') > -1) {
|
||||||
tocNode.scrollIntoView({ block: 'start', behavior: 'smooth' })
|
tocNode.scrollIntoView({ block: 'start', behavior: 'smooth' })
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user