Closed onns closed 4 years ago
LGTM
Thanks for your PR : P
Thanks for your PR : P
ᕙ( • ‿ • )ᕗ
hello!十分抱歉,之前测试的时候都没有在手机上测试过整个页面完整的划到最后= =!所以发生了问题,感觉新一个pr太奇怪了,可以麻烦你修改一下even.js文件吗😂
要用一个if包裹起来
if($(".post-toc").css("display") != "none"){
var maxTocTop = $footer.offset().top - $toc.height() - SPACING;
var tocCenterThreshold = document.documentElement.scrollTop + window.innerHeight / 2;
if ($(".toc-link.active").offset() != undefined && $(".toc-link.active").offset().top > tocCenterThreshold) {
var distanceBetween = $(".post-toc").offset().top - $(".toc-link.active").offset().top;
$(".post-toc").offset({
top: Math.min(maxTocTop, tocCenterThreshold + distanceBetween),
});
}
if (maxTocTop < $(".post-toc").offset().top) {
$(".post-toc").offset({ top: maxTocTop });
}
}
hello!十分抱歉,之前测试的时候都没有在手机上测试过整个页面完整的划到最后= =!所以发生了问题,感觉新一个pr太奇怪了,可以麻烦你修改一下even.js文件吗😂
要用一个if包裹起来
if($(".post-toc").css("display") != "none"){ var maxTocTop = $footer.offset().top - $toc.height() - SPACING; var tocCenterThreshold = document.documentElement.scrollTop + window.innerHeight / 2; if ($(".toc-link.active").offset() != undefined && $(".toc-link.active").offset().top > tocCenterThreshold) { var distanceBetween = $(".post-toc").offset().top - $(".toc-link.active").offset().top; $(".post-toc").offset({ top: Math.min(maxTocTop, tocCenterThreshold + distanceBetween), }); } if (maxTocTop < $(".post-toc").offset().top) { $(".post-toc").offset({ top: maxTocTop }); } }
新发个 PR 来修吧