Skip to content

Commit

Permalink
style: autohide toc 自动隐藏目录区
Browse files Browse the repository at this point in the history
Hide table of contents automatically
if there is no heading (h1-h6) in article.

如果正文中没使用 HTML 标题,
则自动隐藏目录区。
  • Loading branch information
MOxFIVE committed Dec 12, 2015
1 parent bcc29f8 commit b7da666
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions layout/_partial/toc.ejs
Expand Up @@ -33,4 +33,14 @@
document.getElementById("switch-area").style.display="block"; document.getElementById("switch-area").style.display="block";
} }
} }
</script>

<script src="http://7.url.cn/edu/jslib/comb/require-2.1.6,jquery-1.9.1.min.js"></script>
<script>
if ($(".toc").length < 1) {
$("#toc").css("display","none");
$("#tocButton").css("display","none");
$(".switch-btn").css("display","block");
$(".switch-area").css("display","block");
}
</script> </script>
2 changes: 1 addition & 1 deletion source/css/_partial/mobile.styl
Expand Up @@ -320,7 +320,7 @@


/*多说 UA*/ /*多说 UA*/
.ua { .ua {
display: none; display: none !important;
} }


#header .social li:nth-child(5n) { #header .social li:nth-child(5n) {
Expand Down

0 comments on commit b7da666

Please sign in to comment.