We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61086aa commit 619c49eCopy full SHA for 619c49e
source/js/src/post-details.js
@@ -17,6 +17,9 @@ $(document).ready(function () {
17
18
removeCurrentActiveClass();
19
$currentActiveElement.addClass('active-current');
20
+
21
+ // Scrolling to center active TOC element if TOC content is taller then viewport.
22
+ $tocElement.scrollTop($currentActiveElement.offset().top - $tocElement.offset().top + $tocElement.scrollTop() - ($tocElement.height() / 2));
23
})
24
.on('clear.bs.scrollspy', removeCurrentActiveClass);
25
0 commit comments