Releases: gadzan/generatoc
Releases · gadzan/generatoc
v1.3.0
v1.2.4
v1.2.4 Change log
-
New parameter
scrollOffset
ingeneratoc.init()
, default to0
. It could scroll to the target with a vertical offset(pixel). If you have a fixed header in your page, this is what you need to set. -
New parameter
duration
ingeneratoc.init()
, default to7
. The duration of scroll animation, a larger number means slower scroll. It accepts a number large than 1.
Sample:
const scrollOffset = 64 // Scroll to position where 64 pixel distant top of the target.
const duration = 3 // Faster scrolling.
const content = '.post-content'
const heading = ['h2', 'h3', 'h4', 'h5']
const selector = '#toc'
generatoc.init({ content, heading, selector, scrollOffset, duration })