Constructor
# new Help(props)
Parameters:
Name | Type | Description |
---|---|---|
props |
Object | |
selected |
string | The id of selected chapter. |
upperMargin |
number | string | The top-margin of the navigation drawer. |
Methods
# static onScroll()
Callback fired when user scrolls to certain position. Function counts and updates the position of the scroll using chapter positions.
# static scrollTo(id)
Callback fired when user clicked on an element from navigation drawer.
Function updates scroll position using the offsetTop
and offsetHeight
attributes of a chapter.
Parameters:
Name | Type | Description |
---|---|---|
id |
number | The numerical part of the chapter id. |
# static updatePositions()
Updates the margin-right
of the scrollable container.
Then, sets timeout for 1 second with a callback to update the positions of chapter titles.