-
Notifications
You must be signed in to change notification settings - Fork 0
/
nbtoc.html
47 lines (44 loc) · 991 Bytes
/
nbtoc.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!-- extracted from https://gist.github.com/magican/5574556 -->
<div id="toc-wrapper">
<div class="header">Contents <a href="#" class="hide-btn">[hide]</a></div>
<div id="toc"></div>
</div>
<style>
#toc {
overflow-y: scroll;
max-height: 300px;
}
#toc-wrapper {
position: fixed; top: 120px; max-width:430px; right: 20px;
border: thin solid rgba(0, 0, 0, 0.38); opacity: .8;
border-radius: 5px; background-color: #fff; padding:10px;
z-index: 100;
}
#toc-wrapper.closed {
min-width: 100px;
width: auto;
transition: width;
}
#toc-wrapper:hover{
opacity:1;
}
#toc-wrapper .header {
font-size:18px; font-weight: bold;
}
#toc-wrapper .hide-btn {
font-size: 14px;
}
</style>
<style>
ol.nested {
counter-reset: item;
list-style: none;
}
li.nested {
display: block;
}
li.nested:before {
counter-increment: item;
content: counters(item, ".")" ";
}
</style>