Skip to content

Commit

Permalink
Updated doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Semaho committed Nov 23, 2017
1 parent ee4621e commit 1dc1152
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ Just include smoothscroll inside your page, like this:
All your internal links will be tied to a smooth scroll.
If you want to call a smooth scroll from your code, you can now use the API by calling:

`window.smoothScroll(target, duration, callback, context)`
`window.smoothScroll(target, duration, callback, context, offset)`

where:
* `target` is a `HTMLElement Object` from your document that you want to scroll to, or a numeric position on the page
* `duration` is the total duration of the scroll (optional, defaults to 500ms)
* `callback` is a function to be executed when the scrolling is over (optional)
* `context` is the scrolling context (optional, defaults to window, can be any `HTMLElement Object`)
* `offset` is a value (int) you want to add/subtract to/from the endpoint

Alternatively, you can install smoothscroll as a dependency using npm:

Expand Down

0 comments on commit 1dc1152

Please sign in to comment.