Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
fix(toc): fix inaccurate headerLinkTop calculation that result in act…
Browse files Browse the repository at this point in the history
…iveTocIndex drift.
  • Loading branch information
Fedomn committed Feb 9, 2020
1 parent dd6c0f7 commit 440051e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/js/blog.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,11 @@ jQuery(function($) {

const HEADERFIX = 120;
const $toclink = $('.toc-link');
const $headerlink = $('.headerlink');
const $headerDummyLink = $('.post-dummy-target');
const $tocLinkLis = $('.post-toc-content li');
const activeIndex = function () {
const scrollTop = $(window).scrollTop();
const headerlinkTop = $.map($headerlink, function(link) {
const headerlinkTop = $.map($headerDummyLink, function(link) {
return $(link).offset().top;
});
const searchActiveTocIndex = function(array, target) {
Expand Down

0 comments on commit 440051e

Please sign in to comment.