فهرست منبع

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-')