mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
🐛 修復上次更新導致頁面跳動的bug
This commit is contained in:
parent
250181c569
commit
e8a47d040a
@ -532,11 +532,11 @@ $(function () {
|
||||
}, 100)
|
||||
}
|
||||
|
||||
var updateAnchor = function (anchor) {
|
||||
if (anchor !== window.location.hash) {
|
||||
location.replace(window.location.href.split('#')[0] + anchor)
|
||||
}
|
||||
}
|
||||
// function updateAnchor (anchor) {
|
||||
// if (window.history.replaceState && anchor !== window.location.hash) {
|
||||
// window.history.replaceState(null, null, anchor)
|
||||
// }
|
||||
// }
|
||||
|
||||
// find head position & add active class
|
||||
// DOM Hierarchy:
|
||||
@ -565,7 +565,7 @@ $(function () {
|
||||
|
||||
var currentActive = $('.toc-link.active')
|
||||
if (currentId && currentActive.attr('href') !== currentId) {
|
||||
updateAnchor(currentId)
|
||||
// updateAnchor(currentId)
|
||||
|
||||
$('.toc-link').removeClass('active')
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user