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
update README to match latest feature implementations
- offset can be defined as pixel value
- removed pixel value feature request from roadmap
- add explanation on addtional properties provided by callbacks
| 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) |
142
-
| progress |`boolean`| false | Whether to fire incremental step progress updates |
141
+
| 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) |
143
142
| threshold |`number` (greater than 1) | 4 | Granularity of the progress interval in pixels (smaller = more granular) |
144
143
| onStepEnter |`function`|| Callback that fires when the top or bottom edge of a step enters the offset threshold. |
145
144
| onStepExit |`function`|| Callback that fires when the top or bottom edge of a step exits the offset threshold. |
@@ -153,6 +152,7 @@ The `onStepEnter` and `onStepExit` callbacks receive one argument, an object, wi
153
152
element, // The DOM node of the step that was triggered
154
153
data, // The data supplied to the step
155
154
direction, // 'up' or 'down'
155
+
entry, // the original `IntersectionObserver` entry
156
156
}
157
157
```
158
158
@@ -164,6 +164,7 @@ The `onStepProgress` callback receives one argument, an object, with the followi
164
164
data, // The data supplied to the step
165
165
progress, // The percent of completion of the step (0 to 1)
166
166
direction, // 'up' or 'down'
167
+
entry, // the original `IntersectionObserver` entry
167
168
}
168
169
```
169
170
@@ -201,7 +202,6 @@ You will also probably want to set a `key` prop on each `Step` if you're transfo
201
202
202
203
## Features roadmap
203
204
204
-
* Being able to use pixels instead of percent for offset value so stuff on mobile doesn't jump around on scroll direction change
205
205
* 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