Skip to content
Snippets Groups Projects
Commit 35ee4b0b authored by Daniel Kurowski's avatar Daniel Kurowski
Browse files

update readme

parent 44ce597c
No related branches found
No related tags found
1 merge request!12Improve work with value object
...@@ -43,17 +43,15 @@ jumping on the page up and down due to browser native behaviour. ...@@ -43,17 +43,15 @@ jumping on the page up and down due to browser native behaviour.
### scrollToX functions ### scrollToX functions
|Function|Parameters| | Function | Parameters |
|---|---| |----------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|`scrollToElement(element[, onScrollFinishedCallback])`|`element`: element to scroll to; `onScrollFinishedCallback` (optional): callback to trigger when scrolling is finished| | `scrollToElement(element[, onScrollFinishedCallback])` | `element`: element to scroll to; `onScrollFinishedCallback` (optional): callback to trigger when scrolling is finished |
|`scrollToOffset(topOffset[, onScrollFinishedCallback])`|`topOffset`: scroll offset from top of document; `onScrollFinishedCallback` (optional): callback to trigger when scrolling is finished| | `scrollToOffset(topOffset[, onScrollFinishedCallback])` | `topOffset`: scroll offset from top of document; `onScrollFinishedCallback` (optional): callback to trigger when scrolling is finished |
|`scrollToTarget(hashTarget[, onScrollFinishedCallback])`|`hashTarget`: instance of `HashTarget` object\* or `string`\*\*; `onScrollFinishedCallback` (optional): callback to trigger when scrolling is finished| | `scrollToTarget(targetHash[, onScrollFinishedCallback])` | `targetHash`: instance of `Hash` value object\* or hash a `string`; `onScrollFinishedCallback` (optional): callback to trigger when scrolling is finished |
\* `HashTarget` is a value object representing a target to scroll to. \* `Hash` is a value object representing a hash being requested.
You can easily initalize it with named constructor: You can easily initalize it with named constructor:
`HashTarget.fromString('#some-identifier', document)` `Hash.fromString('#some-identifier')`
\*\* In case of passing `string`, `HashTarget` object will be
instantiated automatically with current `document` context.
## More about ## More about
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment