You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| offset |`number` (from 0 to 1) | 0.3 | How far from the top of the viewport to trigger a step (as a proportion of view height) |
141
-
| progress |`boolean`| false | Whether to fire incremental step progress updates |
140
+
| offset |`number` (from 0 to 1) or pixel value (e.g. "300px") | 0.3 | How far from the top of the viewport to trigger a step (as a proportion of view height) |
142
141
| threshold |`number` (greater than 1) | 4 | Granularity of the progress interval in pixels (smaller = more granular) |
143
142
| onStepEnter |`function`|| Callback that fires when the top or bottom edge of a step enters the offset threshold. |
144
143
| onStepExit |`function`|| Callback that fires when the top or bottom edge of a step exits the offset threshold. |
@@ -152,6 +151,7 @@ The `onStepEnter` and `onStepExit` callbacks receive one argument, an object, wi
152
151
element, // The DOM node of the step that was triggered
153
152
data, // The data supplied to the step
154
153
direction, // 'up' or 'down'
154
+
entry, // the original `IntersectionObserver` entry
155
155
}
156
156
```
157
157
@@ -162,6 +162,8 @@ The `onStepProgress` callback receives one argument, an object, with the followi
162
162
element, // The DOM node of the step that was triggered
163
163
data, // The data supplied to the step
164
164
progress, // The percent of completion of the step (0 to 1)
165
+
direction, // 'up' or 'down'
166
+
entry, // the original `IntersectionObserver` entry
165
167
}
166
168
```
167
169
@@ -199,7 +201,6 @@ You will also probably want to set a `key` prop on each `Step` if you're transfo
199
201
200
202
## Features roadmap
201
203
202
-
* Being able to use pixels instead of percent for offset value so stuff on mobile doesn't jump around on scroll direction change
203
204
* Currently, there is no way to throttle/customize React Scrollama's [resize listener](https://github.com/jsonkao/react-scrollama/blob/master/src/Scrollama.js#L104) 😢. We're working on this in [#44](https://github.com/jsonkao/react-scrollama/issues/44).
0 commit comments