소스 검색

fix scroll.js bug when headers are numbers

disfated 2 년 전
부모
커밋
1200738f90
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      content/scroll.js

+ 2 - 2
content/scroll.js

@@ -105,8 +105,8 @@ var scroll = (() => {
         html.scrollTop ? (html.scrollTop = 0, html) : $('body')
       ))()
 
-      if (!update && location.hash && $(location.hash)) {
-        get(container, 'md-', $(location.hash).offsetTop)
+      if (!update && location.hash && document.getElementById(location.hash.slice(1))) {
+        get(container, 'md-', document.getElementById(location.hash.slice(1)).offsetTop)
       }
       else {
         get(container, 'md-')