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.

Example 2

Tab 1
Lorem ipsum dolor sit amet, ex nam odio ceteros fastidii, id porro lorem pro, homero facilisis in cum. At doming voluptua indoctum mel, natum noster similique ne mel.
Tab 2
Reque repudiare eum et. Prompta expetendis percipitur eu eam, et graece mandamus pro, eu vim harum audire tractatos. Ad perpetua salutandi mea, soluta delicata aliquando eam ne. Qui nostrum lucilius perpetua ut, eum suas stet oblique ut.
Tab 3
Vis mazim harum deterruisset ex, duo nemore nostro civibus ad, eros vituperata id cum. Vim at erat solet soleat, eum et iuvaret luptatum, pro an esse dolorum maiestatis.