Autotoc pattern.
Automatically create a table of contents.
Configuration
Option | Type | Default | Description |
---|---|---|---|
IDPrefix | string | 'autotoc-item-' | Prefix used to generate ID. |
classActiveName | string | 'active' | Class used for active level. |
classLevelPrefixName | string | 'autotoc-level-' | Class prefix used for the TOC levels. |
classSectionName | string | 'autotoc-section' | Class used for section in TOC. |
classTOCName | string | 'autotoc-nav' | Class used for the TOC. |
levels | string | 'h1,h2,h3' | Selectors used to find levels. |
scrollDuration | string | 'slow' | Speed of scrolling. |
scrollEasing | string | 'swing' | Easing to use while scrolling. |
section | string | 'section' | Tag type to use for TOC. |
Examples
Example 1
Title 1
Mr. Zuckerkorn, you've been warned about touching. You said spanking. It walked on my pillow! How about a turtle? I've always loved those leathery little snappy faces.
Title 1.1
Ah coodle doodle do Caw ca caw, caw ca caw. Butterscotch!
Title 1.1.1
Want a lick? Okay, Lindsay, are you forgetting that I was a professional twice over - an analyst and a therapist.
Title 2
You boys know how to shovel coal? Don't worry, these young beauties have been nowhere near the bananas. I thought the two of us could talk man-on-man.