lib/isodoc/itu/html/scripts.html in metanorma-itu-1.0.13 vs lib/isodoc/itu/html/scripts.html in metanorma-itu-1.0.14
- old
+ new
@@ -1,25 +1,9 @@
<script>
- //TOC generation
- $('#toc').toc({
- 'selectors': toclevel(), //elements to use as headings
- 'container': 'main', //element to find all selectors in
- 'smoothScrolling': true, //enable or disable smooth scrolling on click
- 'prefix': 'toc', //prefix for anchor tags and class names
- 'onHighlight': function(el) {}, //called when a new section is highlighted
- 'highlightOnScroll': true, //add class to heading that is currently in focus
- 'highlightOffset': 100, //offset to trigger the next headline
- 'anchorName': function(i, heading, prefix) { //custom function for anchor name
- return prefix+i;
- },
- 'headerText': function(i, heading, $heading) { //custom function building the header-item text
- return $heading.text();
- },
- 'itemClass': function(i, heading, $heading, prefix) { // custom function for item class
- return $heading[0].tagName.toLowerCase();
- }
- });
-
+ $("#toc").on('click', 'li', function(e) {
+ $(this).parent().find('li.toc-active').removeClass('toc-active');
+ $(this).addClass('toc-active');
+});
</script>
<script>
//TOC toggle animation
$('#toggle').on('click', function(){