Skip to content

Commit 2bea515

Browse files
committed
Merge branch 'release/2.4.1'
2 parents cd6c34f + 23bc17e commit 2bea515

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ The following are all props that can be passed to the `<Parallax>` component:
8888

8989
| Name | Type | Default | Description |
9090
| -------------- | :-----------------------------: | :------- | ------------------------------------------------------------------------------------------------------------------ |
91-
| **x** | `Array` of `String` or `Number` | `[0, 0]` | Offsets on x-axis in `%` or `px`. If no unit is passed percent is assumed. Percent is based on the elements width. |
92-
| **y** | `Array` of `String` or `Number` | `[0, 0]` | Offsets on y-axis in `%` or `px`. If no unit is passed percent is assumed. Percent is based on the elements width. |
91+
| **x** | `Array` of `String` or `Number` | `[0, 0]` | Initial and final offsets on x-axis in `%` or `px`. If no unit is passed percent is assumed. Percent is based on the elements width. |
92+
| **y** | `Array` of `String` or `Number` | `[0, 0]` | Initial and final offsets on y-axis in `%` or `px`. If no unit is passed percent is assumed. Percent is based on the elements width. |
9393
| **className** | `String` | | Optionally pass additional class names to be added to the outermost parallax element. |
9494
| **disabled** | `Boolean` | `false` | Disables parallax effects on individual elements when `true`. |
9595
| **styleInner** | `Object` | | Optionally pass a style object to be added to the innermost parallax element. |

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-scroll-parallax",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"description": "React components to create parallax scroll effects for banners, images or any other DOM elements.",
55
"repository": {
66
"type": "git",

src/classes/ParallaxController.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ function ParallaxController({ scrollAxis = VERTICAL, scrollContainer }) {
197197
* Updates all parallax element attributes and positions.
198198
*/
199199
this.update = function() {
200+
const nx = hasScrollContainer ? viewEl.scrollLeft : window.pageXOffset;
201+
const ny = hasScrollContainer ? viewEl.scrollTop : window.pageYOffset;
202+
scroll.setScroll(nx, ny);
203+
200204
_setViewSize();
201205
_updateAllElements({ updateCache: true });
202206
};

0 commit comments

Comments
 (0)