title: History back in overflowed div using Tocify
body: <p>Tocify inserts named divs above headers. It uses hash tags to navigate and pushes to history. We use Tocify to target overflowed div content area--it works great. </p>
  
  <p>The back button updates hash and triggers event, but scroll does not execute--no errors. Same logic with hash in window load event works as expected. </p>
  
  <p>What am I missing?</p>
  
  <pre><code>function scrollToAnchor(hash) {
    alert("Scroll to: " + hash);
    var dTag = $("div[name='" + hash + "']");
    $('.topic').animate({ scrollTop: dTag.offset().top }, 'slow');
  }
  
  
    $(window).load(function () {
      var hash = location.hash.replace('#', '');
      if (hash != '') {
        scrollToAnchor(hash);
      }
    });
  
    if (window.history &amp;&amp; window.history.pushState) {
      $(window).on('popstate', function () {
        var hash = location.hash.replace('#', '');
        if (hash != '') {
          scrollToAnchor(hash);
        }
      });
    }
  </code></pre>