Skip to content

Commit 6890e59

Browse files
add offset prop to <Scrollama /> in documentation
1 parent ba76c02 commit 6890e59

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ $ npm install react-scrollama
8181
A `Scrollama` component wraps a set of steps. Each `Step` component [must wrap a DOM element](https://github.com/jsonkao/react-scrollama/issues/19#issuecomment-624861326).
8282

8383
```jsx
84-
<Scrollama onStepEnter={callback}>
84+
<Scrollama onStepEnter={callback} offset={0.5}>
8585
<Step data={1}>
8686
<div>...</div>
8787
</Step>
@@ -113,7 +113,7 @@ const ScrollamaDemo = () => {
113113
<div style={{ position: 'sticky', top: 0, border: '1px solid orchid' }}>
114114
I'm sticky. The current triggered step index is: {currentStepIndex}
115115
</div>
116-
<Scrollama onStepEnter={onStepEnter} debug>
116+
<Scrollama offset={0.5} onStepEnter={onStepEnter} debug>
117117
{[1, 2, 3, 4].map((_, stepIndex) => (
118118
<Step data={stepIndex} key={stepIndex}>
119119
<div

0 commit comments

Comments
 (0)