File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,15 @@ $(function () {
77 e . preventDefault ( ) ;
88 animateScrolling ( this . hash ) ;
99 } ;
10-
10+
11+ // Detect hash on page load and readjust scroll offset
12+ var initialHash = window . location . hash ;
13+ if ( ! ! initialHash ) {
14+ setTimeout ( function ( ) {
15+ animateScrolling ( initialHash ) ;
16+ } , 100 ) ;
17+ }
18+
1119 $ ( "#markdown-toc" )
1220 . on ( "click" , "a" , function ( ) {
1321 $ ( ".section > ul" ) . hide ( ) ;
Original file line number Diff line number Diff line change @@ -52,7 +52,15 @@ $(function() {
5252 e . preventDefault ( ) ;
5353 animateScrolling ( this . hash ) ;
5454 } ;
55-
55+
56+ // Detect hash on page load and readjust scroll offset
57+ var initialHash = window . location . hash ;
58+ if ( ! ! initialHash ) {
59+ setTimeout ( function ( ) {
60+ animateScrolling ( initialHash ) ;
61+ } , 100 ) ;
62+ }
63+
5664 // animated scroll
5765 // Exclude the app inside the div.theme-preview since it's not in an <iframe/>,
5866 // leading to unwanted scrollTop when clicking on links inside the app.
You can’t perform that action at this time.
0 commit comments