Files
prodigyapi/source/javascripts/app/toc.js
Christopher Rogers b171d3c48a Organizes javascript into libraries and application code
Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
2014-04-09 14:54:23 -07:00

25 lines
625 B
JavaScript

$(function() {
var toc = $("#toc").tocify({
selectors: "h1,h2",
extendPage: false,
theme: "none",
smoothScroll: false,
showEffectSpeed: 0,
hideEffectSpeed: 180,
ignoreSelector: ".toc-ignore",
hashGenerator: 'pretty',
highlightOffset: 60,
scrollTo: -2,
scrollHistory: true,
hashGenerator: function(text, element) {
return element[0].getAttribute('id');
}
}).data("toc-tocify");
// Hack to make already open sections to start opened,
// instead of displaying an ugly animation
setTimeout(function() {
toc.setOption("showEffectSpeed", 180);
}, 50);
});