From e8a47d040aec075e5825a53f6fed5e46e83e574b Mon Sep 17 00:00:00 2001 From: Jerry <16351105+jerryc127@users.noreply.github.com> Date: Thu, 30 Apr 2020 00:32:43 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=BE=A9=E4=B8=8A=E6=AC=A1?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=B0=8E=E8=87=B4=E9=A0=81=E9=9D=A2=E8=B7=B3?= =?UTF-8?q?=E5=8B=95=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/js/main.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/js/main.js b/source/js/main.js index 8f05040..52bdc28 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -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')