From 2012.igem.org
(Difference between revisions)
|
|
Line 1: |
Line 1: |
| <html> | | <html> |
| <script> | | <script> |
- | $('#toc').toc({ | + | // call the plugin on the "#toc" element |
- | 'selectors': 'h1,h2,h3', //elements to use as headings
| + | $('#toc').fixedTOC({ |
- | 'container': 'body', //element to find all selectors in
| + | menuOpens: 'click', // or 'mouseenter' |
- | 'smoothScrolling': true, //enable or disable smooth scrolling on click
| + | scrollSpeed: 1000, |
- | 'prefix': 'toc', //prefix for anchor tags and class names
| + | menuSpeed: 300, |
- | 'onHighlight': function(el) {}, //called when a new section is highlighted
| + | useSubMenus: true, |
- | 'highlightOnScroll': true, //add class to heading that is currently in focus
| + | resetSubMenus: true, |
- | 'highlightOffset': 100, //offset to trigger the next headline
| + | topLinkWorks: true |
- | '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();
| + | |
- | }
| + | |
| }); | | }); |
| </script> | | </script> |
- |
| |
| </div> | | </div> |
| | | |
Revision as of 17:18, 30 July 2012