From 758b378e82d6e79ae74c3ad090c6d1758c16747c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=AE=87?= <448766534@qq.com> Date: Tue, 7 Jan 2020 13:12:44 +0800 Subject: [PATCH] fix: change anchor jump to scrollIntoView --- layout/_partial/after-footer.ejs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/layout/_partial/after-footer.ejs b/layout/_partial/after-footer.ejs index eb1b3e1..0d3dec2 100644 --- a/layout/_partial/after-footer.ejs +++ b/layout/_partial/after-footer.ejs @@ -19,6 +19,10 @@ positionFixedSelector: '.tocbot', positionFixedClass: 'is-position-fixed', fixedSidebarOffset: 'auto', + onClick: (e) => { + document.getElementById(e.target.innerText).scrollIntoView() + return false; + } }); <% } %> @@ -40,4 +44,4 @@ - \ No newline at end of file +