Adds option to specify an header height (#1045)

* Adds option to specify an header height

When using a template that has a sticky-header, clicking on the sidebar will
scroll the page under the header.

I added the option `headerHeight` (default = `0`) so that the content div will
be scrolled down that amount of pixels.

* updates documentation and renames variable
This commit is contained in:
Leonardo Rossi
2020-03-09 14:19:31 +05:30
committed by GitHub
parent 562cd7cb3a
commit b53ea1e304
11 changed files with 32 additions and 17 deletions
+13
View File
@@ -575,3 +575,16 @@ window.$docsify = {
```
> Note: The options with fallbackLanguages didn't work with the `notFoundPage` options.
## topMargin
- type: `Number`
- default: `0`
Adds a space on top when scrolling content page to reach the selected section. This is useful in case you have a _sticky-header_ layout and you want to align anchors to the end of your header.
```js
window.$docsify = {
topMargin: 90, // default: 0
};
```