@@ -15,7 +15,6 @@ See it in action:
1515` hash ` is the ` id ` of a HTML tag on current page.
1616
1717
18-
1918## Installation
2019
2120### npm
@@ -108,9 +107,9 @@ export default (props) => (
108107### Reactive ` props`
109108Update ` props` will re-render ` Scrollchor` element
110109
111- Ex : [updating "to" prop](https://github.com/some-react-components/react-scrollchor/blob/example/src/App.js#L28)
110+ Example : [updating "to" prop](https://github.com/some-react-components/react-scrollchor/blob/example/src/App.js#L28)
112111
113- ## Custom animation
112+ ## Custom animations
114113
115114Animation behavior can be customized:
116115
@@ -132,15 +131,15 @@ This setting is equivalent to default jQuery.animate `easing: swing`
132131
133132
134133## ` before` and ` after` Animate callbacks
135- Use these callbacks to trigger behaviors like, for example, update state, load async stuff, etc.
134+ Use these callbacks to trigger behaviors like: update state, load async stuff, etc.
136135` ` ` js
137136< Scrollchor to= " #aboutus" afterAnimate= {() => updateState (this )}> Home< / Scrollchor>
138137` ` `
139138
140139## Simulate click API
141- Scrollchor includes a dedicate API for init animate scroll programmatically that works like normal click events using ` simulateClick ()` .
140+ Scrollchor includes a dedicate API to do animate scroll programmatically that works like normal click events using ` simulateClick ()` .
142141
143- Ex : [using simulateClick](https://github.com/some-react-components/react-scrollchor/blob/example/src/App.js#L17 )
142+ Example : [using simulateClick](https://github.com/some-react-components/react-scrollchor/blob/example/src/App.js#L16 )
144143
145144When used programmatically, some use-cases don't need ` anchor tags` . On these cases use childless ` Scrollchor` .
146145
@@ -149,15 +148,22 @@ This component will render `null` and the user is reponsible for storing the com
149148` ` ` js
150149< Scrollchor ref= {ref => (this ._back = ref)} to= " _back" / >
151150` ` `
152- Ex : [calling ` simulateClick ()` on childless ` ref` ](https://github.com/some-react-components/react-scrollchor/blob/example/src/App.js#L16)
151+ Example : [calling ` simulateClick ()` on childless ` ref` ](https://github.com/some-react-components/react-scrollchor/blob/example/src/App.js#L16)
153152` ` ` js
154153_afterAnimate = () => {
155154 this .setState ({ to: this ._iterator .next ().value });
156155 setTimeout (() => this ._back .simulateClick (), 1000 );
157156};
158157` ` `
159158
160- ## Example
159+ ## Scrollable ancestor container
160+ Scrollchor works within any scrollable parent container. The root element of the ` document ` will be choose if none is specified.
161+
162+ Hosted example show how to use a different container using prop ` target` .
163+ * Click ` Within scrollable container` checkbox: [hosted example](https://some-react-components.github.io/react-scrollchor/)(full example below)
164+
165+
166+ ## Full Example
161167
162168[react-scrollchor--example](https://github.com/some-react-components/react-scrollchor/tree/example)
163169
0 commit comments