forked from lyfeyaj/awesome-resources
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.en.html
37 lines (32 loc) · 924 Bytes
/
index.en.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<article id='container'>
</article>
</body>
<script type="text/javascript">
var bodyEl = document.getElementsByTagName('body')[0];
var markdownToc = document.getElementById('markdown-toc');
bodyEl.appendChild(markdownToc);
var hash = location.hash.replace('#', '');
// Set init highlight anchor
if (hash) {
var activeAnchor = document.getElementById('markdown-toc-' + hash);
if (activeAnchor) {
activeAnchor.classList.add('active');
}
}
markdownToc.onclick = function(e) {
var activeAnchor = document.querySelector('a.active');
if (activeAnchor) {
activeAnchor.classList.remove('active');
}
e.target.classList.add('active')
}
</script>
</html>