m |
m |
||
Line 34: | Line 34: | ||
<script> | <script> | ||
$(document).ready(function() { | $(document).ready(function() { | ||
− | document.getElementById(' | + | document.getElementById('tocnav').insertBefore(document.getElementById('titreps'), document.getElementById('tocnav').firstChild); |
document.getElementById('compl').appendChild(document.getElementById('toc')); | document.getElementById('compl').appendChild(document.getElementById('toc')); | ||
document.getElementById('toctitle').outerHTML = ""; | document.getElementById('toctitle').outerHTML = ""; | ||
+ | //$('#toc').children("ul").addClass("nav"); | ||
+ | $('#toc').children("ul").attr('id', 'tocnav'); | ||
+ | $('#tocnav').addClass('nav'); | ||
+ | $('body').scrollspy({ target: '#toc', offset:40 }); | ||
+ | |||
+ | $('#toc').on('activate.bs.scrollspy', function () { | ||
+ | $('li.active').prevAll().addClass('before'); | ||
+ | $('li.active').removeClass('before'); | ||
+ | $('li.active').nextAll().removeClass('before'); | ||
+ | }) | ||
+ | $('#toc').affix({ | ||
+ | offset: { | ||
+ | top: 40, | ||
+ | bottom: function () {return (this.bottom = $('.footer').outerHeight(true) + 100)} | ||
+ | } | ||
+ | }) | ||
}); | }); | ||
</script> | </script> |
Revision as of 10:17, 9 October 2016