From 1dc1152529f72ce43f936537371f9574c808f871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Vignol?= Date: Thu, 23 Nov 2017 17:58:11 +0100 Subject: [PATCH] Updated doc. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 219cddc..2ad9147 100644 --- a/README.md +++ b/README.md @@ -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: