fix: 目录弹窗直接定位到当前章节,去掉滚动动画
This commit is contained in:
parent
a51fd5045f
commit
76f39363a0
@ -576,13 +576,13 @@
|
|||||||
});
|
});
|
||||||
tocList.innerHTML = html;
|
tocList.innerHTML = html;
|
||||||
|
|
||||||
// 自动滚动到当前章节
|
// 自动定位到当前章节(无动画)
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const currentItem = tocList.querySelector('.current');
|
const currentItem = tocList.querySelector('.current');
|
||||||
if (currentItem) {
|
if (currentItem) {
|
||||||
currentItem.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
currentItem.scrollIntoView({ block: 'center' });
|
||||||
}
|
}
|
||||||
}, 100);
|
}, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新移动端目录高亮
|
// 更新移动端目录高亮
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user