A jQueryUI Table of Contents Plugin
Supports HTML5 History pushstate API (via History.js) for forward and back button support
Supports styling with jQueryUI Themeroller
Supports show/hide animations with jQuery effects
Supports smooth scrolling animations
Supports dynamic scroll highlighting
Supports dynamic scroll show/hide effects
Supports page extender option to make sure a page is big enough to scroll to all table of content items
The latest version of jQuery is always recommended
The latest version of the jQueryUI Widget Factory is always recommended
History.js is required if you want forward and back button support.
Note: If you do not include History.js, then Tocify will not have history support, but it will still be functional.
Download the latest versions of...
1. jQueryThe container element that holds all of the elements used to generate the table of contents.
Accepts String: Any jQuery selector
context: "body"
The element's used to generate the table of contents. The order is very important since it will determine the table of content's nesting structure
Accepts a String Array: Each string must be a valid jQuery selector
selectors: ["h1"]
Used to display any of the table of contents nested items
Accepts String: "none", "fadeIn", "show", "slideDown", or any of the jQueryUI show effects (i.e. "bounce")
showEffect: "slideDown"
The time duration of the show animation
Accepts Number (milliseconds) or String: "slow", "medium", or "fast"
showEffectSpeed: "medium"
Used to hide any of the table of contents nested items
Accepts String: "none", "fadeOut", "hide", "slideUp", or any of the jQueryUI hide effects (i.e. "explode")
hideEffect: "slideUp"
The time duration of the hide animation
Accepts Number (milliseconds) or String: "slow", "medium", or "fast"
hideEffectSpeed: "medium"
Animates the page scroll when specific table of content items are clicked and the page moves up or down
Accepts a boolean: true or false
smoothScroll: true
The time duration of the smoothScroll animation
Accepts Number (milliseconds) or String: "slow", "medium", or "fast"
smoothScrollSpeed: "medium"
Determines if table of content nested items should be shown and hidden while a user scrolls the page
Accepts a boolean: true or false
showAndHideOnScroll: true
Determines if table of content nested items should be highlighted (set to a different background color to show it is the currently active item) while scrolling
Accepts a boolean: true or false
highlightOnScroll: true
The offset distance in pixels to trigger the next active table of contents item
Accepts a number
highlightOffset: 40
Determines if jqueryUI or regular CSS classes will be added to the table of contents
Accepts a boolean: true or false
jqueryUI: true
If a user scrolls to the bottom of the page and the page is not tall enough to scroll to the last table of contents item, then the page height is increased
Accepts a boolean: true or false
extendPage: true