We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
具体这样做的。 在原来的基础上添加,当滑动到对应的标题时候,目录对应添加class属性read .esa-catalog-contents .read{ color: #e06c75; }
下面是js代码
The text was updated successfully, but these errors were encountered:
效果如我的博客: https://www.cnblogs.com/code609/p/11807231.html
Sorry, something went wrong.
No branches or pull requests
具体这样做的。
在原来的基础上添加,当滑动到对应的标题时候,目录对应添加class属性read
.esa-catalog-contents .read{
color: #e06c75;
}
下面是js代码
<script type="text/javascript"> function showArticleIndex() { var anchorList = $(".esa-anchor"); // 监听浏览器滚动条,当浏览过的标签,给他上色。 $(window).on("scroll", function(e){ var windowTop = $(window).scrollTop(); anchorList.each(function(item, index){ var anchorTop = $(this).offset().top; var node = $(this).attr("href").replace(/^#/gi,''); var tocLink = $('.esa-catalog-contents ul i[class=' + node + ']'); if ( anchorTop <= windowTop+200 ) { tocLink.parent("li").addClass("read"); } else { tocLink.parent("li").removeClass("read"); } }); }); } showArticleIndex(); </script>The text was updated successfully, but these errors were encountered: