vjeantet / hugo-theme-docdock

Declination of @matcornic Learn theme to Hugo

Home Page:https://docdock.netlify.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

content position can''t follow current doc page

kanghaiyang opened this issue · comments

with following code, we can fix the issue.

docdock/static/theme-flex/script.js
@@ -170,6 +170,15 @@ jQuery(document).ready(function() {
     });
 
     $('article a:not(:has(img)):not(.btn)').addClass('highlight');
+
+    // Fix the scroll's position for the actived content node.
+    try {
+        if( $('.menu .active').offset() ) {
+            var offset = $('.menu .active').offset().top - $('header').height() - 50;
+            $('article > aside').scrollTop(offset);
+        }
+    } catch (e) {}
+
 });

Hi @kanghaiyang,

Could you please expand more what exactly is the issue and how to repeat it?

Thanks!