diff --git a/source/javascripts/app/_toc.js b/source/javascripts/app/_toc.js index 17e785c..bb651b0 100644 --- a/source/javascripts/app/_toc.js +++ b/source/javascripts/app/_toc.js @@ -3,6 +3,8 @@ ;(function () { 'use strict'; + var loaded = false; + var debounce = function(func, waitTime) { var timeout = false; return function() { @@ -57,6 +59,12 @@ } } + // Catch the initial load case + if (currentTop == scrollOffset && !loaded) { + best = window.location.hash; + loaded = true; + } + var $best = $toc.find("[href='" + best + "']").first(); if (!$best.hasClass("active")) { // .active is applied to the ToC link we're currently on, and its parent