jgallen23 / toc

Table of Contents Plugin
http://projects.jga.me/toc/
MIT License
531 stars 111 forks source link

Added callback for when a new section is highlighted #10

Closed dtaylor closed 12 years ago

dtaylor commented 12 years ago

My table of contents was taller than the page, so when I scrolled far enough down I could no longer see the active TOC section. This change adds a callback for when the highlighted element changes, and is passed the newly highlighted element. In my case, I am using the scrollintoview plugin [1] to make the section visible.

[1] https://github.com/litera/jquery-scrollintoview